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

'extra_hosts' not working anymore in 'docker stack deploy' #11463

Closed
membersound opened this issue Feb 5, 2024 · 1 comment
Closed

'extra_hosts' not working anymore in 'docker stack deploy' #11463

membersound opened this issue Feb 5, 2024 · 1 comment

Comments

@membersound
Copy link

Description

So far, it was possible to pass docker compose config output to docker stack deploy without problems.

Today I upgraded to docker 25.0.2, and discovered loss of the extra_hosts mapping. The tag is completely ignored with the command, and nothing is written to /etc/hosts anymore!

This might be related to:
compose-spec/compose-spec#156
docker/buildx#2201

Steps To Reproduce

cat docker-compose.yml

version: '3.8'

services:
  app:
    image: httpd:2.4
    extra_hosts:
      - "host.docker.internal:host-gateway"

Run:

docker compose config | (sed '/^name:/d') | docker stack deploy -c - httpd

Compose Version

Docker Compose version v2.24.5

Docker Environment

Client: Docker Engine - Community
 Version:    25.0.2
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.12.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.24.5
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 1
  Running: 1
  Paused: 0
  Stopped: 0
 Images: 10
 Server Version: 25.0.2
 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 splunk syslog
 Swarm: active
  NodeID: j9wtq70drkn7uz09ve5cx7iru
  Is Manager: true
  ClusterID: 3kmynxgzfqluz4h5wv46zpu4j
  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: 127.0.0.1
  Manager Addresses:
   127.0.0.1:2377
 Runtimes: runc io.containerd.runc.v2
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc version: v1.1.12-0-g51d5e94
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.2.0-39-generic
 Operating System: Ubuntu 23.04
 OSType: linux
 Architecture: x86_64
 CPUs: 16
 Total Memory: 62GiB
 Name: 
 ID: 
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Username: 
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Anything else?

No response

@ndeloof
Copy link
Contributor

ndeloof commented Feb 6, 2024

I guess the root cause is the adoption of = as canonical separator as host=IP, see compose-spec/compose-go#499

We are not in charge for the docker stack command, please report this issue to docker/cli

@ndeloof ndeloof closed this as not planned Won't fix, can't repro, duplicate, stale Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants