我有一个名为
docker-compose.yml
的文件,可以通过docker-compose up --build
命令运行。我的应用程序可以正常工作,一切都很好。version: '3'
services:
myapp:
container_name: myapp
restart: always
build: ./myapp
ports:
- "8000:8000"
command: /usr/local/bin/gunicorn -w 2 -b :8000 flaskplot:app
nginx:
container_name: nginx
restart: always
build: ./nginx
ports:
- "80:80"
depends_on:
- myapp
但是当我使用 docker stack deploy -c docker-compose.yml myapp
命令时,出现以下错误:
Ignoring unsupported options: build, restart
Ignoring deprecated options:
container_name: Setting the container name is not supported.
Creating network myapp_default
Creating service myapp_myapp
failed to create service myapp_myapp: Error response from daemon: rpc error: code = InvalidArgument desc = ContainerSpec: image reference must be provided
有什么提示可以帮助我将docker-compose.yml
文件转换为与docker stack deploy
兼容的格式吗?