ENV variable substitution no longer working in Dockerfiles? #7358
Labels
bug
Issue identified by VS Code Team member as probable bug
containers
Issue in vscode-remote containers
verified
Verification succeeded
Milestone
VS Code version: 1.72.0
Dev Containers version: 0.255.3
Host operating system: Ubuntu 22.04
Docker version: 20.10.18
We have a base docker image that specifies an ENV variable for a user name. We build that docker image outside of vscode.
We then have a separate "dev" dockerfile that builds on this image that we open with the Dev Container extension. This "dev" dockerfile needs to use the ENV variable from the base image.
This has been working for us for a year or two now. A couple of days ago it stopped working, build/launch log attached.
If we replace the ENV variable with a hard-coded value in the "dev" dockerfile it works again. Perhaps ENV variable substitution is broken?
NOTE: once this error has occurred we have to remove the built images and containers from docker cache before a new working image can be built (eg with
docker system prune
). Probably not everything, but we wanted to be sure.I made a minimal reproducible example, attached.
Steps to reproduce:
docker build -t testbaseimage -f Dockerfile.base .
.devcontainer/Dockerfile
(the "dev" dockerfile referred to above):# USER $MYUSER
, andUSER testuser
remoteContainers-2022-10-13T00-20-23.815Z.log
test.zip
The text was updated successfully, but these errors were encountered: