We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm trying to set some variables like the image name from .env, to run it in docker swarm as follows:
docker stack deploy -c <(docker stack config -c docker-compose.yml) my-app
Problem: docker stack config loses tags that use values from .env file, see steps to reproduce.
docker stack config
.env
cat docker-compose.yml:
cat docker-compose.yml
services: app: image: $APPLICATION_IMAGE #env_file: '.env' ports: - 8090:8080
.env: APPLICATION_IMAGE=my.docker.repo/my-app:latest
APPLICATION_IMAGE=my.docker.repo/my-app:latest
docker stack config -c docker-compose.yml:
docker stack config -c docker-compose.yml
services: app: ports: - mode: ingress target: 8080 published: 8090 protocol: tcp
image tag should be present and filled with value from .env:
image
services: app: image: my.docker.repo/my-app:latest ports: - mode: ingress target: 8080 published: 8090 protocol: tcp
Client: Docker Engine - Community Version: 24.0.5 API version: 1.43 Go version: go1.20.6 Git commit: ced0996 Built: Fri Jul 21 20:35:23 2023 OS/Arch: linux/amd64 Context: default Server: Docker Engine - Community Engine: Version: 24.0.5 API version: 1.43 (minimum version 1.12) Go version: go1.20.6 Git commit: a61e2b4 Built: Fri Jul 21 20:35:23 2023 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.22 GitCommit: 8165feabfdfe38c65b599c4993d227328c231fca runc: Version: 1.1.8 GitCommit: v1.1.8-0-g82f18fe docker-init: Version: 0.19.0 GitCommit: de40ad0
Client: Docker Engine - Community Version: 24.0.5 Context: default Debug Mode: false Plugins: buildx: Docker Buildx (Docker Inc.) Version: v0.11.2 Path: /usr/libexec/docker/cli-plugins/docker-buildx compose: Docker Compose (Docker Inc.) Version: v2.20.2 Path: /usr/libexec/docker/cli-plugins/docker-compose Server: Containers: 34 Running: 11 Paused: 0 Stopped: 23 Images: 479 Server Version: 24.0.5 Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Using metacopy: false Native Overlay Diff: true userxattr: false Logging Driver: json-file Cgroup Driver: systemd Cgroup Version: 2 Plugins: Volume: local Network: bridge host ipvlan macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Swarm: active NodeID: m98663673nkszvyj3f2fnctvd Is Manager: true ClusterID: 4tigljlfpmc4aqt5yb2nrz7x6 Managers: 1 Nodes: 1 Default Address Pool: 10.0.0.0/8 SubnetSize: 24 Data Path Port: 4789 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.134.214 Manager Addresses: 192.168.134.214:2377 Runtimes: io.containerd.runc.v2 runc Default Runtime: runc Init Binary: docker-init containerd version: 8165feabfdfe38c65b599c4993d227328c231fca runc version: v1.1.8-0-g82f18fe init version: de40ad0 Security Options: apparmor seccomp Profile: builtin cgroupns Kernel Version: 5.15.0-73-generic Operating System: Ubuntu 22.04.3 LTS OSType: linux Architecture: x86_64 CPUs: 2 Total Memory: 11.66GiB Name: svdev4 ID: DKLD:FBO7:72JP:LPYR:JKGE:GKJR:CQEA:AWEC:HGNC:DFCZ:HDES:LN4H Docker Root Dir: /var/lib/docker Debug Mode: false Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false Default Address Pools: Base: 11.0.0.0/16, Size: 24
No response
The text was updated successfully, but these errors were encountered:
This looks like a duplicate of #29133
closing this one, so that the conversation doesn't diverge.
Sorry, something went wrong.
No branches or pull requests
Description
I'm trying to set some variables like the image name from .env, to run it in docker swarm as follows:
docker stack deploy -c <(docker stack config -c docker-compose.yml) my-app
Problem:
docker stack config
loses tags that use values from.env
file, see steps to reproduce.Reproduce
cat docker-compose.yml
:.env
:APPLICATION_IMAGE=my.docker.repo/my-app:latest
docker stack config -c docker-compose.yml
:Expected behavior
image
tag should be present and filled with value from .env:docker version
Client: Docker Engine - Community Version: 24.0.5 API version: 1.43 Go version: go1.20.6 Git commit: ced0996 Built: Fri Jul 21 20:35:23 2023 OS/Arch: linux/amd64 Context: default Server: Docker Engine - Community Engine: Version: 24.0.5 API version: 1.43 (minimum version 1.12) Go version: go1.20.6 Git commit: a61e2b4 Built: Fri Jul 21 20:35:23 2023 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.22 GitCommit: 8165feabfdfe38c65b599c4993d227328c231fca runc: Version: 1.1.8 GitCommit: v1.1.8-0-g82f18fe docker-init: Version: 0.19.0 GitCommit: de40ad0
docker info
Additional Info
No response
The text was updated successfully, but these errors were encountered: