Nic*_*ick 7 docker dockerfile docker-compose docker-swarm
使用命令时,我是否绝对需要在我的目录中有一个 Dockerfile docker-compose up
?我不相信 Dockerfile 是必要的,但想确定。
如果我只有一个使用预构建图像的 docker-compose.yml 文件,则不需要 Dockerfile。
请纠正我!提前致谢。
docker-compose 允许您在 2 个选项之间进行选择
从指定的镜像构建容器:
services:
example:
image: your/imagename
Run Code Online (Sandbox Code Playgroud)从 Dockerfile 构建容器:
services:
example:
build:
context: path/to/Dockerfile/dir
dockerfile: Dockerfile #here you specify the name of your Dockerfile file
Run Code Online (Sandbox Code Playgroud) 归档时间: |
|
查看次数: |
2420 次 |
最近记录: |