Docker command / option to display or display the context of the assembly

Is there a command / option to display or a list of context that is sent to the Docker daemon to create the image?

$ docker build -t "image-name"
Sending build context to Docker daemon 8.499 MB
...

Files and directories can be excluded from the build context by specifying templates in the file .dockerignore. I assume that what I am looking for comes down to testing .dockerignorein addition to any other niche rules that Docker uses when defining context.

+4
source share
1 answer

The only way is to add the current directory to a specific directory and list it.

Try creating this Docker file:

FROM busybox

RUN mkdir /tmp/build/
# Add context to /tmp/build/
ADD . /tmp/build/

Build it with:

docker build -t test .

List all the files and directories in / tmp / build:

docker run --rm -it test find /tmp/build
+4

Source: https://habr.com/ru/post/1676491/


All Articles