Skip to content

Conversation

@rjackson
Copy link
Contributor

I have a custom build hook to pass in build arguments on a repository from which I build two Docker images (tags), from two Dockerfiles.

My second build, however, with the custom Dockerfile, was not being built correctly. It was being built with the default Dockerfile, instead of my specified custom one.

I quickly figured out the custom build hook was to blame because it doesn't specify which Dockerfile it should build from, but there was no mention in the documentation of an environmental variable I can consume to get the custom "Dockerfile location" value. By dumping the env vars during the build process, I can there is an environmental variable with that value: DOCKERFILE_PATH.

This PR updates the documentation accordingly, to:

  1. Expose the fact this environmental variable exists, and explains its purpose
  2. Make sure its consumed in the example custom build hook, so any copy-pasters find themselves already supporting custom Dockerfiles, rather than struggling with the same problem

Proposed changes

Unreleased project version (optional)

Related issues (optional)

I have a custom build hook to pass in build arguments on a repository from which I build two Docker images (tags), from two Dockerfiles.

My second build, however, with the custom Dockerfile, was not being built correctly. It was being built with the default `Dockerfile`, instead of my specified custom one.

I quickly figured out the custom build hook was to blame because it doesn't specify which Dockerfile it should build from, but there was no mention in the documentation of an environmental variable I can consume to get the custom "Dockerfile location" value. By dumping the env vars during the build process, I can there is an environmental variable with that value: `DOCKERFILE_PATH`.

This PR updates the documentation accordingly, to:

1) Expose the fact this environmental variable exists, and explains its purpose
2) Make sure its consumed in the example custom build hook, so any copy-pasters find themselves already supporting custom Dockerfiles, rather than struggling with the same problem
@joaofnfernandes
Copy link
Contributor

@KickingTheTV can you confirm that we set the DOCKERFILE_PATH environment variable during the build stage?

@gbarr01 gbarr01 added the area/build Relates to Dockerfiles or docker build command label Feb 16, 2018
@joaofnfernandes
Copy link
Contributor

Thanks! Let's ship it 🚀

@joaofnfernandes joaofnfernandes merged commit 6e0df9e into docker:master Feb 24, 2018
shin- pushed a commit to shin-/docker.github.io that referenced this pull request Mar 1, 2018
I have a custom build hook to pass in build arguments on a repository from which I build two Docker images (tags), from two Dockerfiles.

My second build, however, with the custom Dockerfile, was not being built correctly. It was being built with the default `Dockerfile`, instead of my specified custom one.

I quickly figured out the custom build hook was to blame because it doesn't specify which Dockerfile it should build from, but there was no mention in the documentation of an environmental variable I can consume to get the custom "Dockerfile location" value. By dumping the env vars during the build process, I can there is an environmental variable with that value: `DOCKERFILE_PATH`.

This PR updates the documentation accordingly, to:

1) Expose the fact this environmental variable exists, and explains its purpose
2) Make sure its consumed in the example custom build hook, so any copy-pasters find themselves already supporting custom Dockerfiles, rather than struggling with the same problem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Relates to Dockerfiles or docker build command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants