-
Notifications
You must be signed in to change notification settings - Fork 310
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
Local image as the base image of remote dev container Dockerfile #7425
Comments
I see an error only when rebuilding the container with one of the "Without Cache" commands (e.g., |
I have the same issue and I can reproduce it with the example snippets from @corford . The local image FROM alpine
CMD ["echo", "Hello!"] and is located in my local docker cache (e.g. listed in When I now click
So the main error messages in here are that VSCode is trying to pull the app from docker.io instead of checking in the local cache first:
By the way @chrmarti do you know where all the |
Are you maybe using a different builder that has not access to Not sure where the |
@chrmarti thanks for your earlier reply. Somehow I missed the obvious difference between Happy to confirm using a local base image works fine with the latter command (as one would expect). This was with Ubuntu 18.04.6 LTS and docker 20.10.19. |
@chrmarti thanks for the hint with Since both @corford s and my issue have been resolved, I believe you can close the issue. Thanks again for the help. |
Thanks, closing as resolved. |
Creating a dev container from a Dockerfile that references a locally built base image is not currently possible (VSCode calls
docker buildx build
with the--pull
flag, which causes docker to ignore local images and instead try to pull them from thedocker.io
repository).For example, this does not work (assuming
my-app:1.0.1-test
is a locally built image i.e. not yet pushed to a repository):Dockerfile:
devcontainer.json
Being able to reference a local base image (as illustrated above) would be very useful when locally developing and testing a new base image for use with the project's devcontainer (since it avoids having to push it to a registry on each dev/test iteration, which is especially helpful if the base image is large... ours is ~4GB).
Since the blocker for this is the aforementioned
--pull
arg being passed todocker buildx build
, I wonder ifdevcontainer.json
spec could be extended with a way to signal that the--pull
flag should not be passed tobuildx
e.g. via an extra prop in thebuild.
options?The text was updated successfully, but these errors were encountered: