简体   繁体   English

如何制作本地docker容器?

[英]How can I make a local docker container?

I installed Docker and kitematic. 我安装了Docker和kitematic。 I had VirtualBox before that and used many machines on Vbox. 在此之前,我拥有VirtualBox,并在Vbox上使用了许多计算机。 Docker is working, I can pull containers and other stuff like that. Docker在工作,我可以拉容器之类的东西。 Like this link : https://docs.docker.com/mac/started/ I can add containers by: 像这个链接: https : //docs.docker.com/mac/started/我可以通过以下方式添加容器:

<i> docker run docker/whalesay cowsay boo </i>

I want to know if there is any way that I can import some of my Vbox machines into docker as a Container locally? 我想知道是否可以将某些Vbox计算机作为本地容器​​导入docker? I have ova and ovf file in my local pc. 我的本地PC中有ova和ovf文件。 I don't wanna get involved with online containers! 我不想参与在线容器! Is there any way to accomplish this. 有什么办法可以做到这一点。 Thank you. 谢谢。

Looks like you have some confusion on the concept of a container. 看起来您对容器的概念有些困惑。

A container is not a virtual machine . 容器不是虚拟机

You can't import virtual machines into Docker. 您无法将虚拟机导入Docker。 What you can do is build and run a Docker container which eliminates the need for a virtual machine (depending on your use case of course). 您可以做的是构建并运行一个Docker容器,从而无需使用虚拟机(当然,这取决于您的用例)。

You can find a good explanation about the difference between a container and a virtual machine here . 您可以在此处找到有关容器和虚拟机之间差异的很好的解释。

TL;DR : TL; DR

Both virtual machines and containers allow you to run multiple applications on a shared hardware. 虚拟机和容器都允许您在共享硬件上运行多个应用程序。

When using virtual machines , the hardware is shared among all applications, however each application runs on a separate operating system . 使用虚拟机时 ,硬件在所有应用程序之间共享,但是每个应用程序都在单独的操作系统运行

When using containers , both the hardware AND the operating system are shared, and each application runs in a separate container . 使用容器时硬件操作系统都是共享的,并且每个应用程序都在单独的容器中运行。

This is in no way an exhaustive explanation regarding Docker containers - there are MANY more advantages to using Docker instead of a virtual machine (portability, consistency, infrastructure-as-code). 这绝不是关于Docker容器的详尽解释-使用Docker而不是虚拟机有更多优势(可移植性,一致性,基础架构即代码)。 This is just the main difference between them. 这只是它们之间的主要区别。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从docker容器内部发出请求似乎来自我的本地计算机? - How can I make a request coming from inside of a docker container appear to be coming from my local machine? 如何从 KSQL docker 容器连接到本地 Kafka? - How can I connect to Kafka local from KSQL docker container? 如何使运行Docker容器通过新更改实现 - How can i make Running Docker container to Realize with new changes 如何在 Docker 容器中自动重启 golang 应用程序? - How I can make autorestarts golang application in Docker container? 如何使 docker 容器 IP 地址在 WLAN 中可访问? - How can I make docker container IP addresses accessible in a WLAN? 我如何确保始终连接到相同的Docker容器? - How can I make sure to always connect to the same docker container? 如何使 Docker 容器中的 /etc/hosts 可由 root 写入? [关闭] - How can I make /etc/hosts writable by root in a Docker Container? [closed] 如何使用配置数据制作Docker容器的多个副本? - How can I make multiple copies of a docker container WITH configuration data? 如何在docker-compose v3中通过本地网络访问容器? - How do I make a container accessible over the local network in docker-compose v3? 如果没有找到具有该名称的本地映像,我如何告诉 docker 从本地映像创建容器,而不查看 docker 集线器? - How can I tell docker to create a container from a local image, without looking at the docker hub if no local image is found with that name?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM