Skip to content

docker stack cmd not recognizing compose v3.5 network name option #1025

Closed

Description

@Adirio

Description
docker stack deploy -c docker-compose.yml my_stack ignores name network option. It still uses the networks map key as the name and prepends it with the stack prefix (in this case my_stack_) when it should use the provided name and bit prepend it with the prefix as explianed in docker/compose#3736, implemented in docker/compose#5448 and documented here

If this bug does not belong in here please tell me where I can report it.

Steps to reproduce the issue:

  1. Create a docker-compose.yml file with the following content
version: "3.5"

services:
  visualizer:
    image: dockersamples/visualizer:stable
    ports:
      - "8080:8080"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"
    deploy:
      placement:
        constraints: [node.role == manager]
    networks:
      - netalias

networks:
  netalias:
    name: netname
  1. Run a docker daemon and init a swarm
  2. Run docker stack deploy -c docker-compose.yml my_stack

Describe the results you received:

Creating network my_stack_netalias
Creating service my_stack_visualizer

Describe the results you expected:

Creating network net1
Creating service my_stack_visualizer

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version:

Client:
 Version:       18.02.0-ce
 API version:   1.36
 Go version:    go1.9.4
 Git commit:    fc4de447b5
 Built: Mon Feb 12 19:03:38 2018
 OS/Arch:       windows/amd64
 Experimental:  false
 Orchestrator:  swarm

Server:
 Engine:
  Version:      18.04.0-ce
  API version:  1.37 (minimum version 1.12)
  Go version:   go1.9.4
  Git commit:   3d479c0
  Built:        Tue Apr 10 18:23:35 2018
  OS/Arch:      linux/amd64
  Experimental: false

Output of docker info:

Containers: 1
 Running: 1
 Paused: 0
 Stopped: 0
Images: 3
Server Version: 18.04.0-ce
Storage Driver: aufs
 Root Dir: /mnt/sda1/var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 27
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: active
 NodeID: iiy6mje4hutw2b8fbnqdl1mtb
 Is Manager: true
 ClusterID: 42pjb21q2x2p2xqw1opelth4y
 Managers: 1
 Nodes: 2
 Orchestration:
  Task History Retention Limit: 5
 Raft:
  Snapshot Interval: 10000
  Number of Old Snapshots to Retain: 0
  Heartbeat Tick: 1
  Election Tick: 10
 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.99.100
 Manager Addresses:
  192.168.99.100:2377
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 773c489c9c1b21a6d78b5c538cd395416ec50f88
runc version: 4fc53a81fb7c994640722ac585fa9ca548971871
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.93-boot2docker
Operating System: Boot2Docker 18.04.0-ce (TCL 8.2.1); HEAD : b8a34c0 - Wed Apr 11 17:00:55 UTC 2018
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 995.6MiB
Name: myvm1
ID: GIHT:4V3L:EA7U:X5WK:5TYO:JVZR:M63I:BZRA:BSVR:PSBG:XOBG:XOZG
Docker Root Dir: /mnt/sda1/var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
 provider=virtualbox
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

Additional environment details (AWS, VirtualBox, physical, etc.):
I was using a 2-virtualbox-nodes with 1 master swarm but that should not influence the output.

Activity

  1. chrizzly123 commented on Apr 27, 2018

    @chrizzly123

    Hey,
    this should already be fixed in 18.04, I havent tried it by myself tho.
    Can you try to update your client to 18.04 too? Docker version says its still 18.02.
    Hope that helps!

  2. Adirio commented on Apr 27, 2018

    @Adirio
    Author

    Reinstalled docker toolbox but it still only got me to 18.03.

    Output of docker version:

    Client:
     Version:       18.03.0-ce
     API version:   go1.9.4
     Git comFri Mar 23 08:31:36 2018
     OS/Arch:       falsews/amd64
     Orchestrator:  swarm
    
    Server:
     Engine:        18.04.0-ce
      API version:  go1.9.4inimum version 1.12)
      Git commit:   Tue Apr 10 18:23:35 2018
      OS/Arch:      false/amd64
      Experimental:
    

    Don't know why the terminal is behaving this way, should get translated into:

    Client:
     Version:       18.03.0-ce
     API version:   No idea
     Go version:    go1.9.4
     Git commit:    No idea
     Built: Fri Mar 23 08:31:36 2018
     OS/Arch:       windows/amd64
     Experimental:  false
     Orchestrator:  swarm
    
    Server:
     Engine:
      Version:      18.04.0-ce
      API version:  1.37 (minimum version 1.12)
      Go version:   go1.9.4
      Git commit:   3d479c0
      Built:        Tue Apr 10 18:23:35 2018
      OS/Arch:      linux/amd64
      Experimental: false
    

    I'm loosing API version and Git commit info, but no clue why it is reporting the version like this.

    Still no luck with 18.03, will wait for the next release (18.06?)

  3. chrizzly123 commented on Apr 27, 2018

    @chrizzly123

    Hey,
    You can get 18.04 here. Note that this is the edge channel, so its like a beta. And 18.05 RC is alpha like. Else, you really have to wait for 18.06. Hope that helps!

  4. Adirio commented on Apr 27, 2018

    @Adirio
    Author

    Can I install that over the docker toolbox transparently?

  5. chrizzly123 commented on Apr 27, 2018

    @chrizzly123

    No idea, sorry ¯_(ツ)_/¯

  6. thaJeztah commented on Jun 7, 2024

    @thaJeztah
    Member

    Closing; this should be fixed by #941

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions