Open RammusXu opened 4 years ago
Is this Docker or buildx? It is expected that if you use docker-container
driver you can't refer to the local docker instance images as container driver runs in an isolated environment and doesn't use docker storage.
@tonistiigi
It's supposed to be buildx
since I used export DOCKER_BUILDKIT=1
.
so, is it possible to pass resource from a local docker image more elegant?
For now I can do
Mount a directory in a temporary docker container and copy resources.
docker run --rm -v $PWD/my-cache:/root/my-cache pc sh -c "cp -r /root/cache/* /root/my-cache"
Pass copied resource as a read only mount in Dockerfile
RUN --mount=type=bind,target=/root/cache,source=my-cache \
ls -lat /root/cache
Question
I expect
--mount=type=bind,from=pc
will use my local image but it seems to fetch dockerhub. Is it possible to configure this?Steps
Build a image named:
pc
Build another image to mount
pc
sourcedocker build -t demo --progress=plain .
Other