我正在尝试使用 docker 堆栈部署应用程序。建立与泊坞窗,撰写(已运行测试后完全确定),我创建了一个群,加入它,并试图逃跑
docker stack deploy --compose-file docker-compose.yml default
Run Code Online (Sandbox Code Playgroud)
出现以下错误:
failed to create service default_sharkcop-api: Error response from daemon: rpc error: code = InvalidArgument desc = ContainerSpec: image reference must be provided
Run Code Online (Sandbox Code Playgroud)
这是我的 docker-compose.yml
version: "3"
services:
# Define the api web application
sharkcop-api:
# Build the Dockerfile that is in the web directory
build:
context: ./sharkcop-api
dockerfile: Dockerfile
# Always restart the container regardless of the exit status; try and restart the container indefinitely
restart: always
# …Run Code Online (Sandbox Code Playgroud)