Docker Community Forums

Share and learn in the Docker community.

Sending build context to Docker daemon seems quite high

build

(Jamieg) #1

I’ve watched other people build their Dockerfile and the build context isn’t as high as mine is, I’m curious why?

Here is the output:

sudo docker build .
Sending build context to Docker daemon 841.5 MB
Step 1 : FROM ubuntu
—> 4ca3a192ff2a
Step 2 : CMD bash
—> Using cache
—> 84085f6608da
Step 3 : RUN apt-get -qq update
—> Using cache
—> 0b5db15d51c5
Successfully built 0b5db15d51c5

Any help would be appreciated, it is also my first time here so any tips about questions are appreciated also.


(Ktwalrus) #2

The build context is all the files/directories in the current directory (the ‘.’ directory from the docker build command).

Keep only files you need for the build in this directory. That is, the Dockerfile and any local files/directories copied/added to the build image in the Dockerfile.


(Jamieg) #3

Thanks, I’ve moved the Dockerfile to its own dir now and its running much faster!


(Matuszeman) #4

Use .dockerignore file to exclude files/folders not relevant to the build.