-
Notifications
You must be signed in to change notification settings - Fork 322
Linux: 'Rebuild Container Without Cache' doesn't re-pull image when using 'image' in devcontainer.json #7104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It should remove the current container and create a new one. Does that not work? E.g., you can check with |
Sorry for the confusion, I confirmed it does make a new container but it does not re-pull the image the same way it does as if you are using a Dockerfile. Attached are logs of the docker ps and |
Any update on this? It looks like this is a regression according to #3128. |
We are hitting the same issue. We ship a container image that contains the tools required to build our project. When we roll out a new version of the tools, the workflow for users is:
Ideally the workflow would be for our our dev container configuration to specify that the tools might be updated and for VS Code to periodically (or when explicitly triggered by the user) poll the container registry for a newer version and give users the option to update if they don't have the latest version, then recreate the container. |
@davidchisnall A workaround I have been using in this case to help improve that workflow for my team, is to add an "initializeCommand" to devcontainer.json that pulls the most recent image (docker pull devcontainerimagename:latest) every time, along with publishing the dev container images using a single known tag ("latest" or whatever you prefer). It's not perfect, but it means that you can use "Dev Containers: Rebuild Container Without Cache", or just restart vscode, instead of all of the steps you outlined. |
This is still broken, any update? |
We removed |
@chrmarti I'm using BuildKit now, but still the image is not updated when using 'Rebuild without Cache'. Or am I missing something?
|
@tbsuht You're right, this is a bug when we use the |
@chrmarti Any idea when a fix can be expected? |
@chrmarti Any news? |
…ge before create container (#2873) ## What do these changes do? since the `Rebuild Container Without Cache` of VS code is [not work](microsoft/vscode-remote-release#7104), this change using a workaround to pull newer image before create the container. Signed-off-by: acezen <[email protected]>
@chrmarti push |
1 similar comment
@chrmarti push |
Still an issue....vscode should be checking for a new image version on a rebuild without cache. |
I am not sure if this is the same issue (image not being refreshed) but this happens to me as well. I use a Dockerfile however e.g Even when I use "Rebuild Container without Cache," I am currently having to update the image manually on Docker Desktop by using "Pull." If not, the next time I use "Rebuild Container" it uses the older image |
Same issue here. |
This would be nice to have |
Same issue. Any workarounds ? |
Currently, we can explictly have the docker pull command as |
We’ve been using that same workaround for the past year. On Feb 16, 2024, at 2:40 AM, Xuan (Sean) Hu ***@***.***> wrote:
Same issue. Any workarounds ?
Currently, we can explictly have the docker pull command as initializeCommand.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Confirmed that the issue still exists, even when using a Dockerfile.
{
"build": {
"dockerfile": "Dockerfile",
"args": {
"IMAGE_URL": "mcr.microsoft.com/devcontainers/base",
"IMAGE_TAG": "bullseye"
}
}
}
Rebuild Container without Cache does not pull the latest image in this case; it uses the existing image on the host. |
Bump. This is annoying! |
@huxuan workaround does the job. We did it with a |
Steps to Reproduce:
Does this issue occur when you try this locally?: Yes
Does this issue occur when you try this locally and all extensions are disabled?: Yes
Hello! I've noticed that calling 'Rebuild Container Without Cache' only works properly when the devcontainer.json is using 'dockerFile' and not 'image'. When the json file is using a Dockerfile, the container is fully rebuilt, but when it is just using 'image', no rebuild occurs and the container just restarts. Is this intentional?
The text was updated successfully, but these errors were encountered: