Expected behavior
Have the hostname set in the container
See Allow --hostname with --net=host by jheiss · Pull Request #20177 · moby/moby · GitHub
Actual behavior
Hostname is moby
.
Information
- the output of:
Moby Menu > Diagnose & Feedback
on OSX
E35C5561-87C2-40BB-845B-135B23234B85
Docker for Mac: version: mac-v1.12.0-beta16.2
OS X: version 10.11.5 (build: 15F34)
logs: /tmp/20160627-132748.tar.gz
failure: No error was detected
[OK] docker-cli
[OK] app
[OK] menubar
[OK] virtualization
[OK] system
[OK] osxfs
[OK] db
[OK] slirp
[OK] moby-console
[OK] logs
[OK] vmnetd
[OK] env
[OK] moby
[OK] driver.amd64-linux
- a reproducible case if this is a bug, Dockerfiles FTW
compose.yml:
version: ‘2’
services:
service1:
image: nginx
hostname: myname
network_mode: host
docker-compose -f compose.yml up -d
docker exec -it _service1_1 hostname
moby
- host distribution and version: OSX 10.11.x
Steps to reproduce the behavior
- copy docker compose file above
- start container
- check hostname
- Same thing happens without compose: docker run --hostname myname --net=“host” nginx