The official athens Docker image ignore --add-host parameter
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 4.8k
- Forks
- 544
- Avg merge
- 7d 21h
- Merged PRs (30d)
- 2
Description
Describe the bug
When running the gomods/athens image from the hub, it ignores the --add-host option.
It seems it comes from this bug : docker-library/docker#82
So I guess we should add some nsswitch.conf?
My use case was to test vanity urls hosted internally. And for testing, I ran a https://github.com/GoogleCloudPlatform/govanityurls on my host, so I needed a way for it to be accessed from the athens container.
Error Message
To Reproduce
Have a service like https://github.com/GoogleCloudPlatform/govanityurls running on your machine on port :80. It should be configured to point to some github repository.
docker run -d --name athens --add-host mydomain.com:172.17.0.1 -v /home/dolanor/var/lib/athens:/var/lib/athens -e ATHENS_DISK_STORAGE_ROOT=/var/lib/athens -e ATHENS_STORAGE_TYPE=disk gomods/athens:latest
export GOPROXY=http://`docker inspect -f "{{ .NetworkSettings.IPAddress}}"`:3000 athens
export GO111MODULE=on
go get -v mydomain.com/mypkg
Expected behavior
The athens proxy container should try to go on mydomain.com that is running on the host and from there go to a private repo on github
Environment (please complete the following information):
- OS: Linux 64bit
- Go version : Go 1.12.5
- Proxy version : 2019-05-09-20:44:12-UTC
- Storage (fs/mongodb/s3 etc.) : disk
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the documented docker run with --add-host and inspect how the official gomods/athens image handles name resolution. Done means a container started this way can resolve mydomain.com and fetch the configured vanity URL through the host service.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- infrastructure, networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100