The Cardano team has since patched the repository to address the issue.
They did not, however, revert the problem file to it'sits previous working state. Instead they re-introduced the file using a different method and with different contents. Namely, the new nsswitch.confnsswitch.conf
file only contains hosts: dns file
Apparently, this seems to have solved the problem for many, but there are still some cases where it is failing.
The workaround that wutzebaer posted still works, but I have a few improvements:
i. The nsswitch.conf file only needs to contain.
hosts: file dns
note the order is file dns
, not dns file
The reordering of these properties is the new fix that needs to be made officially.
ii. The nsswitch.conf file should be stored in the project where it can be committed to the repository, not in the user's home directory. In this way, the project remains self-contained and not dependent on any user-specific environment.
The
nsswitch.conf
file only needs to contain.hosts: file dns
Note that the order is
file dns
, notdns file
The reordering of these properties is the new fix that needs to be made officially.
The
nsswitch.conf
file should be stored in the project where it can be committed to the repository, not in the user's home directory. In this way, the project remains self-contained and not dependent on any user-specific environment.
The new instructions:
The new instructions:
- create
<project folder>/.devcontainer/nsswitch.conf
with the contents:hosts: file dns
- Update the devcontainer.json to mount the nsswitch.conf in the container.
{ "name": "Plutus Starter Project", "image": "docker.io/inputoutput/plutus-starter-devcontainer:v1.0.10", "remoteUser": "plutus", "mounts": [ // This shares cabal's remote repository state with the host. We don't mount the whole of '.cabal', because // 1. '.cabal/config' contains absolute paths that will only make sense on the host, and // 2. '.cabal/store' is not necessarily portable to different version of cabal etc. "source=${localEnv:HOME}${localEnv:USERPROFILE}/.cabal/packages,target=/home/plutus/.cabal/packages,type=bind,consistency=cached", "source=${localWorkspaceFolder}/.devcontainer/nsswitch.conf,target=/etc/nsswitch.conf,type=bind,consistency=cached", ], "settings": { // Note: don't change from bash so it runs .bashrc "terminal.integrated.shell.linux": "/bin/bash" }, // IDs of extensions inside container "extensions": [ "haskell.haskell" ], }
hosts: file dns
- Update the devcontainer.json to mount the nsswitch.conf in the container.
{
"name": "Plutus Starter Project",
"image": "docker.io/inputoutput/plutus-starter-devcontainer:v1.0.10",
"remoteUser": "plutus",
"mounts": [
// This shares cabal's remote repository state with the host. We don't mount the whole of '.cabal', because
// 1. '.cabal/config' contains absolute paths that will only make sense on the host, and
// 2. '.cabal/store' is not necessarily portable to different version of cabal etc.
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.cabal/packages,target=/home/plutus/.cabal/packages,type=bind,consistency=cached",
"source=${localWorkspaceFolder}/.devcontainer/nsswitch.conf,target=/etc/nsswitch.conf,type=bind,consistency=cached",
],
"settings": {
// Note: don't change from bash so it runs .bashrc
"terminal.integrated.shell.linux": "/bin/bash"
},
// IDs of extensions inside container
"extensions": [
"haskell.haskell"
],
}
This is because the HOME environment variable is not a standard variable in windowsWindows, although many people may have it defined due to various (often 'nix-like) software installs. Microsoft's recommendation is to pair ${localEnv:HOME}${localEnv:USERPROFILE}
since HOME is only valid for linuxLinux and USERPROFILE is only valid for windowsWindows.