Creating docker containers on Windows

主宰稳场 提交于 2021-02-10 14:19:16

问题


So getting boot2docker up and running, and pulling containers from the Docker Hub are non-issue on a windows environment. But if I wish to create a container and run it, how do I go about doing this? I've read about using fig, but is fig installed via Windows or from the container? I've attempted to do it from the container, but it often results in a permissions error, and even CHOWNing the folder doesn't solve the issue of not being able to call fig in the container.

Is it even possible to just run docker via Boot2Docker on windows as a development environment? Or should I just use Vagrant as the host VM and play with a bunch of docker containers in it?

Just some clarification and direction would be appreciated.


回答1:


Fig is a tool for working with Docker. It runs on the host (which could mean your Windows host communicating with Docker via the TCP socket, or could mean your boot2docker VM which is a guest of your windows machine and a host of your Docker containers).

All that Fig's doing is streamlining the process of pulling, building and starting Docker images. For example, this fig.yml

db:
 image: postgres
app:
 build: .
 links:
  - "db:db"
 environment:
  - FOO=bar

is (roughly) the same as this series of Docker commands in Bash:

docker run -d --name db postgres
docker build -t app .
docker run -d --name app --link=db:db --env=FOO=bar app


来源:https://stackoverflow.com/questions/28052753/creating-docker-containers-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!