Error resolving own hostname when using Docker Compose #14518
Unanswered
danfarinoeyecue
asked this question in
Codespaces
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We are using a Docker Compose based Codespace and are occasionally getting errors like
unable to resolve host 7430bc41-1f8a-4586-bb06-50ee2022cf07: Temporary failure in name resolution
.It looks like Codespaces is telling Docker to set the hostname and to add a
/etc/hosts
entry for that hostname. I see this in the file/workspaces/.codespaces/shared/merged_devcontainer.json
, in therunArgs
section:This issue seems to say that
runArgs
is not used for Docker Compose devcontainer workspaces.This is not a blocker for us: I added a hard-coded
hostname
to the first service in mydocker-compose.yml
file, and addedecho "127.0.0.1 $(hostname)" | sudo tee -a /etc/hosts
to a script that is run bypostStartCommand
indevcontainer.json
.If there is a more conventional way to solve this, please let me know. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions