Skip to content

Documentation for docker stack deploy using multiple compose files is wrong #976

Description

@dpyro

The documentation for docker stack deploy is wrong for multiple compose files. I could not find the proper method documented anywhere.

Steps to reproduce the issue:

$ docker stack deploy --compose-file docker-compose.yml -f docker-compose.test.yml enode_test

Describe the results you received:

unknown shorthand flag: 'f' in -f
See 'docker stack deploy --help'.

Describe the results you expected:

The proper method appears to be

$ docker stack deploy --compose-file docker-compose.yml --compose-file docker-compose.test.yml enode_test

Output of docker version:

Client:
 Version:       18.03.0-ce
 API version:   1.37
 Go version:    go1.9.4
 Git commit:    0520e24
 Built: Wed Mar 21 23:06:28 2018
 OS/Arch:       windows/amd64
 Experimental:  false
 Orchestrator:  swarm

Server:
 Engine:
  Version:      18.03.0-ce
  API version:  1.37 (minimum version 1.12)
  Go version:   go1.9.4
  Git commit:   0520e24
  Built:        Wed Mar 21 23:14:32 2018
  OS/Arch:      linux/amd64
  Experimental: true

Output of docker info:

 Running: 4
 Paused: 0
 Stopped: 0
Images: 5
Server Version: 18.03.0-ce
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host ipvlan macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: active
 NodeID: ax91vgxq0fxdo6lllrr6nxuav
 Is Manager: true
 ClusterID: x3t7so7jty2azf7vq2zostmv3
 Managers: 1
 Nodes: 1
 Orchestration:
  Task History Retention Limit: 5
 Raft:
  Snapshot Interval: 10000
  Number of Old Snapshots to Retain: 0
  Heartbeat Tick: 1
  Election Tick: 3
 Dispatcher:
  Heartbeat Period: 5 seconds
 CA Configuration:
  Expiry Duration: 3 months
  Force Rotate: 0
 Autolock Managers: false
 Root Rotation In Progress: false
 Node Address: 192.168.65.3
 Manager Addresses:
  192.168.65.3:2377
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: cfd04396dc68220d1cecbe686a6cc3aa5ce3667c
runc version: 4fc53a81fb7c994640722ac585fa9ca548971871
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.87-linuxkit-aufs
Operating System: Docker for Windows
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 1.934GiB
Name: linuxkit-00155d01f514
ID: 3H3V:GAYL:IDZ7:CRPW:2SIZ:55KN:PWQ4:NM5S:DVVM:VVGG:GGGT:3T53
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 74
 Goroutines: 201
 System Time: 2018-03-30T22:12:39.8986699Z
 EventsListeners: 5
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

Note: this also appears to happen on macOS.

Additional environment details (AWS, VirtualBox, physical, etc.):

Docker for Windows and Docker Machine.

Activity

  1. self-assigned this
    on Apr 3, 2018
  2. vdemeester commented on Apr 3, 2018

    @vdemeester
    Collaborator

    @dpyro thx for the report, the flag is indeed --compose-file or -c (shortand). I'll fix that today 😉

  3. JvnB commented on Oct 16, 2018

    @JvnB

    At

    https://docs.docker.com/engine/reference/commandline/stack_deploy/#compose-file

    I still find:

    docker stack deploy --compose-file docker-compose.yml -f docker-compose.prod.yml vossibility

    should be

    docker stack deploy --compose-file docker-compose.yml --compose-file docker-compose.prod.yml vossibility ?

  4. Sachinbihade commented on Jan 31, 2019

    @Sachinbihade

    but does it even work with correct method?
    I am getting this
    Error response from daemon: rpc error: code = 3 desc = ContainerSpec: image reference must be provided.
    This means its not merging two docker compose files, and picking up just the second one.
    Here is the command I am using
    env $(cat .env | grep ^[A-Z] | xargs) $(cat .override_env | grep ^[A-Z] | xargs) docker stack deploy -c docker-compose.yml -c docker-compose.override.yml test_services

  5. thaJeztah commented on Feb 1, 2019

    @thaJeztah
    Member

    @Sachinbihade could you open a new ticket and a (minimal) example to reproduce your issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions