Reputation: 29
I have following images inside my docker registry:
Lets assume that file-finder image is derived from ls_files. If so, can I tell that file-finder shares 996MB of disk storage with ls_files image and has only 58,72MB of his own storage?
Upvotes: 0
Views: 67
Reputation: 4123
No, you assumption is incorrect.
I think your Dockerfile
is probably like this:
FROM ls_files
RUN # Your commands, etc.
Then you run:
docker build -t file-finder:1.0.0 .
Now the image file-finder
is a complete and stand-alone image. You can remove ls_files
with no issue since the image ls_files
is now included and downloaded into the file-finder
image.
When you build an image on top of another, the base image then has nothing to do with the new image and you can remove the base.
Example
FROM alpine:latest
RUN apk add nginx
ENTRYPOINT ["nginx", "-g", "daemon off"]
Let us run:
docker build -t my_nginx:1 .
Now let us remove alpine:latest
image.
docker image rm alpine:latest
Now let's run my_nginx:1
image and you should see no error.
Upvotes: 1