buildx icon indicating copy to clipboard operation
buildx copied to clipboard

`--add-host` not working

Open codemeleon opened this issue 1 year ago • 0 comments

Contributing guidelines

I've found a bug and checked that ...

  • [x] ... the documentation does not mention anything about my problem
  • [x] ... there are no open or closed issues that are related to my problem

Description

I have two servers with the same operating system (OS: Ubuntu 22.04.5 LTS x86_64) and both run Docker (Docker version 24.0.7, build 24.0.7-0ubuntu2~22.04.1). I'm trying to access host web-services from inside a container. I followed the instructions from https://docs.docker.com/reference/cli/docker/container/run/#add-host and used the "hello from host" example. On one system, it works; however, on another server, it fails to access the web-server.

Expected behaviour

$docker run \
  --add-host=host.docker.internal:host-gateway \
  curlimages/curl -s host.docker.internal:8000/hello

hello from host!

Actual behaviour

$docker run \
  --add-host=host.docker.internal:host-gateway \
  curlimages/curl -s host.docker.internal:8000/hello

Buildx version

github.com/docker/buildx 0.12.1 0.12.1-0ubuntu2.1

Docker info

Client:
 Version:    24.0.7
 Context:    default
 Debug Mode: false

Server:
 Containers: 88
  Running: 0
  Paused: 0
  Stopped: 88
 Images: 26
 Server Version: 24.0.7
 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: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 
 runc version: 
 init version: 
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 5.15.0-119-generic
 Operating System: Ubuntu 22.04.5 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 7.746GiB
 Name: beamish
 ID: dc8ba74f-07f6-4561-a227-ed950578027c
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Builders list

NAME/NODE DRIVER/ENDPOINT STATUS BUILDKIT PLATFORMS
default * docker
default default running v0.11.7+d3e6c1360f6e linux/amd64, linux/amd64/v2, linux/386

Configuration

NA

Build logs

No response

Additional info

No response

codemeleon avatar Oct 18 '24 10:10 codemeleon