Skip to content

Change in behavior using secrets in a stack deploy with Docker 17.05.0-ce-rc1 #32822

Description

@jwbennet

Description

I am on the edge channel for Docker for Windows and last week it updated me to the latest release candidate for 17.05. After that I am having issues referencing secrets during a docker stack deploy command when using a Docker Compose file.

In previous versions I could reference existing secrets if they were prefixed with the name of the stack. For example, I could reference a secret named "test_password" with the name "password" in my docker-stack.yml file when I deployed it to a stack named "test".

If I list the secret as external in my docker-stack.yml file with this name it appears to work fine so this may be a change in behavior but I didn't see it listed in the release notes so I wanted to ask about it.

Steps to reproduce the issue:

  1. Create a secret using a "test" prefix: echo 'hello-world' | docker secret create test_password -
  2. Put the following contents into a file named docker-stack.yml:
version: '3.1'
services:
  nginx:
    image: "nginx:1.13.0-alpine"
    deploy:
      replicas: 1
    secrets:
      - source: password
        target: password
        uid: '100'
  1. Deploy the stack: `docker stack deploy -c docker-stack.yml test

Describe the results you received:

The deploy fails with the following output:

Creating network test_default
service master: undefined secret "password"

Describe the results you expected:

I ran this same test on 17.03 using the "stable" channel and it deploys the service without issue. Further, if I exec into the container created for the service I can print out the contents of the secret without issue on this version so I know it is connecting to the secret which I created as part of this test. I also believe this was working on 17.04 so it seems like it might be related to a change in 17.05.

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

Output of docker version:

Client:
 Version:      17.05.0-ce-rc1
 API version:  1.29
 Go version:   go1.7.5
 Git commit:   2878a85
 Built:        Tue Apr 11 20:55:05 2017
 OS/Arch:      windows/amd64

Server:
 Version:      17.05.0-ce-rc1
 API version:  1.29 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   2878a85
 Built:        Tue Apr 11 20:55:05 2017
 OS/Arch:      linux/amd64
 Experimental: true

Output of docker info:

Containers: 12
 Running: 3
 Paused: 0
 Stopped: 9
Images: 3
Server Version: 17.05.0-ce-rc1
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
Swarm: active
 NodeID: sbbtbpzm9udzkt5mgw6sn51wn
 Is Manager: true
 ClusterID: 8y4v2zrdaztmnnxqv1d9nskx5
 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
 Node Address: 192.168.65.2
 Manager Addresses:
  192.168.65.2:2377
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9048e5e50717ea4497b757314bad98ea3763c145
runc version: 9c2d8d184e5da67c95d601382adf14862e4f2228
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.21-moby
Operating System: Alpine Linux v3.5
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.934GiB
Name: moby
ID: G7AL:WU6K:ZEDJ:KGRN:U34W:FMJ4:WLK2:XE7J:3IKI:3QEE:FDH6:4ZOA
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 62
 Goroutines: 177
 System Time: 2017-04-25T18:33:10.1352934Z
 EventsListeners: 3
Registry: https://index.docker.io/v1/
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

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

I am using the Edge channel in Docker for Windows

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions