Skip to content

Instantly share code, notes, and snippets.

@RagedUnicorn
Last active July 25, 2018 17:07
Show Gist options
  • Save RagedUnicorn/a0b827426c42d18fdfcc3569cb0cb341 to your computer and use it in GitHub Desktop.
Save RagedUnicorn/a0b827426c42d18fdfcc3569cb0cb341 to your computer and use it in GitHub Desktop.
Testing the docker build context

Docker Test Build-Context

Checking what is inside the context sent to the docker daemon and whether the configured .dockerignore is behaving as expected can be achieved with the following guide.

Create a dockerfile with the name Dockerfile.build-context

FROM busybox
COPY . /build-context
WORKDIR /build-context
CMD find .

Then the created dockerfile can be built and run.

docker build -f Dockerfile.build-context -t build-context .
docker run --rm -it build-context

This will print the content of the build context allowing to analyze the content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment