Vscode-remote-release: Allow rebuild container without cache

Created on 27 Jan 2020  路  4Comments  路  Source: microsoft/vscode-remote-release


Sometimes I have a Dockerfile that installs software downloaded form Internet. If download fails (cause a network failure or something), the image is build anyway.

The problem is that I can't force VSCode to rebuild the image (so, once the network issue is fixed, the software can be downloaded and installed) using Remote-Containers: Rebuild Container as it always uses cache.

Please provide a Remote-Containers: Rebuild Container without Cache, or similar command, containing the --no-cache option.

containers feature-request

Most helpful comment

yes I think especially for devcontainers where we want always with the latest version the --no-chache option should be possible. I would be happy with a buildArgs in the devcontainer.json
Better to have the no-chache everytime (and pay this with some seconds startup time) than to have outdated stuff in the development environment.

All 4 comments

I too would like this feature. I sometimes have issues in nodejs where an issue with docker itselfs requires me to rebuild the entire image. But I can't. My only workaround is to change the source image from node:12 to node:11 and vice-versa. This should be either an option in .devcontainer.json or an entirely new command.

do an echo "something" run command when you want to rebuild, ugly, but useful

yes I think especially for devcontainers where we want always with the latest version the --no-chache option should be possible. I would be happy with a buildArgs in the devcontainer.json
Better to have the no-chache everytime (and pay this with some seconds startup time) than to have outdated stuff in the development environment.

Work around: copy the docker build command from the log, append --no-cache and run in a separate terminal, return to vscode and "Re-open in Container" to use the refreshed cache
(helpfully, the paths in the command appear to use absolute paths, so you can just copy-paste)

Was this page helpful?
0 / 5 - 0 ratings