How do you add items to .dockerignore?

前端 未结 8 1023
醉话见心
醉话见心 2020-12-29 01:04

I\'m not able to find many examples of what a .dockerignore file should look like.

Using puppet to install a few packages on a docker container causes the image to

8条回答
  •  没有蜡笔的小新
    2020-12-29 01:53

    The format of the .dockerignore should be equal to the one of .gitignore. See a sample file and the docker documentation.

    The file should be a list of exclusion patterns (relative to the path of the .dockerignore file) separated by a newline.

    So you should try the following .dockerignore:

    modules/*
    

    The / at the beginning may have been the mistake, as it will only be valid for the root directory of the file (but not for subdirectories, so maybe the recursive version without the / will do a better job instead).

提交回复
热议问题