Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker stack deploy should not ignore '.env' file or listed env_files #114

Closed
3 tasks done
fedaykin opened this issue Sep 26, 2017 · 1 comment
Closed
3 tasks done

Comments

@fedaykin
Copy link

fedaykin commented Sep 26, 2017

  • This is a bug report
  • This is a feature request
  • I searched existing issues before opening this one

Expected behavior

Documentation for .env and for env_file state, respectively, that "You can set default values for any environment variables referenced in the Compose file, or used to configure Compose, in an environment file named .env" or "Add environment variables from a file."
Unlike other Compose commands, there is no indication that this is unsupported for docker stack deploy.

This may be considered a duplicate of the moby issue #29133 opened Dec 5, 2016, however, the documentation still offers no indication that this feature is not functional.

Actual behavior

Value undefined

Steps to reproduce the behavior

$ cat .env
FOOVAR=bar

$ cat docker-compose.yml
version: '3'
services:
  test:
    env_file: .env
    environment:
      - FOO=${FOOVAR}
    image: alpine
    command: echo Value $FOO undefined


$ docker stack deploy --compose-file docker-compose.yml test 
$ docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                      PORTS               NAMES
468de4a96e8c        alpine:latest       "echo Value undefined"   2 seconds ago       Created                                         test_test.1.ks7s5pnbrgg903sq2f7ut6jqo

$ docker logs 468de4a96e8c
Value undefined

The same effect occurs without the env_file: .env line, or with "$FOOVAR" in the actual command.

Output of docker version:

Client:
 Version:      17.06.2-ce
 API version:  1.30
 Go version:   go1.8.3
 Git commit:   cec0b72
 Built:        Tue Sep  5 20:00:17 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.06.2-ce
 API version:  1.30 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   cec0b72
 Built:        Tue Sep  5 19:59:11 2017
 OS/Arch:      linux/amd64
 Experimental: false

Output of docker info:

Containers: 5
 Running: 0
 Paused: 0
 Stopped: 5
Images: 16
Server Version: 17.06.2-ce
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 158
 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: jmjplhopudpoe18lparcabavw
 Is Manager: true
 ClusterID: q8isixp4guj1biwokwx511fip
 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
 Root Rotation In Progress: false
 Node Address: 10.0.2.15
 Manager Addresses:
  10.0.2.15:2377
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 6e23458c129b551d5c9871e5174f6b1b7f6d1170
runc version: 810190ceaa507aa2727d7ae6f4790c76ec150bd2
init version: 949e6fa
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.10.0-33-generic
Operating System: Linux Mint 18.2
OSType: linux
Architecture: x86_64
CPUs: 3
Total Memory: 11.73GiB
Name: REDACTED
ID: NXAO:QMNB:R5C4:SVDZ:YTTF:CGOP:RZFR:YMBL:Z2DQ:B63V:QIBJ:MDT4
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

WARNING: No swap limit support

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

@fedaykin fedaykin changed the title docker stack deploy ignores both '.env' file and listed env_files docker stack deploy should not ignore '.env' file or listed env_files Sep 26, 2017
@fedaykin
Copy link
Author

Duplicate of docker/docs#3654 and moby/moby#29133

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant