Docker ~ For example, Doc kerignore, dockerignore

Source: Internet
Author: User

Docker ~ For example, Doc kerignore, dockerignore

Back to directory

Recently, I have been focusing on docker development, but I found a problem when using Dockerfile. When your release directory can only be obj \ Docker \ publish, but dockefile pointing to other directories does not recognize it, only prompt

I have found a lot of materials and no one has ever said this, so I 'd better study it myself!

When I found this .doc kerignore file in the vsresolution, it was a miracle! (You cannot see it on VS in the solution)

I personally think that dockerignore is mainly used in the rejected path! The path of is accepted, but not in it.

In the file manager, you can see

Then let's take a look at its content.

The answer is displayed. The first line of "*" indicates that all directories are rejected, and the second line is rejected "! "Indicates the acceptable path. Add our directory here, and then docker build will be OK.

OK. Deploy docker in your own way! I finally found the reason!

If you want to delete all directories, you only need to delete the .doc kerignore file. Note that it is not displayed on linux.

Back to directory

 

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.