4

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.

6

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.

  • In my case, it was the .vagrant-directory, which was around 5GB. I was confused because it's not mentioned in the Dockerfile at all, but this makes sense. Be ware! – Lukas Knuth Jun 20 at 21:55

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.