Docker build "Sending build context to Docker daemon 10.62GB" why so big?

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.

1 Answer

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.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like