Skip to content

pre_start containers don't inherit/support extra_hosts #13939

Description

@hberntsen

Description

Hi, thanks for the awesome pre_start feature!

We're running into the problem that we 're not seeing extra_hosts in the pre_start containers being applied. For example:

services:
  test:
    image: busybox
    extra_hosts:
      - "somehost:162.242.195.82"
    pre_start:
      - command: cat /etc/hosts
    command: cat /etc/hosts

Then, running docker compose up outputs:

laughing_hertz  | 127.0.0.1	localhost
laughing_hertz  | ::1	localhost ip6-localhost ip6-loopback
laughing_hertz  | fe00::	ip6-localnet
laughing_hertz  | ff00::	ip6-mcastprefix
laughing_hertz  | ff02::1	ip6-allnodes
laughing_hertz  | ff02::2	ip6-allrouters
laughing_hertz  | 172.19.0.2	731eafcc9089
laughing_hertz exited with code 0
test-1          | 127.0.0.1	localhost
test-1          | ::1	localhost ip6-localhost ip6-loopback
test-1          | fe00::	ip6-localnet
test-1          | ff00::	ip6-mcastprefix
test-1          | ff02::1	ip6-allnodes
test-1          | ff02::2	ip6-allrouters
test-1          | 162.242.195.82	somehost
test-1          | 172.19.0.2	876dcd9db560
test-1 exited with code 0

The somehost is not visible in the laughing_hertz pre_start container.

Activity

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