Problem with sending build context to Docker daemon when resolving Docker build

Source: Internet
Author: User

When using the Dockerfile build image, it is sometimes found that the content sent to daemon is too large

sending build context to docker daemon  4.358 gbstep 0 : from xxx.xxx.com/centos:7 ---> 218081f3bcdcstep 1  : RUN mkdir -p /data/mysql/base ---> Using cache --->  ac4aa04a93a1Step 2 : RUN adduser mysql ---> Using cache  ---> f30c90e0e589Step 3 : ADD base /data/mysql/base --->  3666ada5715cremoving intermediate container d65c5abdfe5cstep 4 : entrypoint  /data/mysql/base/entrypoint.sh ---> Running in 3be4e22baff7 --->  a73907b2fbd5removing intermediate container 3be4e22baff7successfully built  A73907b2fbd5 
REPOSITORY TAG IMAGE ID CREATED VIRTUAL sizemarriadb latest A73907b2fbd5 seconds AG o 530.9 MB



But our dokerfile is very simple, so where does this extra content come from?

Discover that Docker client will send all files in the Dockerfile sibling directory to Dockerdaemon by default

There are two ways to solve this problem:

1. Create the. dockerignore file, write the unwanted files inside, the file contains the directory will not be sent to the Docker daemon

2. Just find an empty directory only dockerfile.


Problem with sending build context to Docker daemon when resolving Docker build

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.