I'm introducing myself to docker from a book and I followed a simple instruction to make a Dockerfile and run the build command as follows:
Dockerfile contents:
FROM busybox:latest
CMD echo Hello World!
then I ran:
sudo docker build .
in the folder that the Dockerfile was in. My question is, what exactly is the 10.62GB that is in the "Sending build context to Docker daemon"? to build this image it took about 7 or 8 minutest to build while this figure climbed its way up to 10.62GB. Is that normal? I thought, is this representing the image size because I thought container images were relatively small?
Thanks.
The build context that is being sent to the Docker daemon is all the files/folders that are in the current directory that you specified in the command
sudo docker build .
In your current directory, try to only have the files/folders necessary for building your image. This would include your Dockerfile, and any required files/folders you are porting into your Docker image.
You can also create a
.dockerignore
file to specify the files/folders you would want Docker to ignore when building.