Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker-build man page doesn't reflect new rules for Dockerfile path #1549

Open
starthal opened this issue Dec 5, 2018 · 1 comment
Open

Comments

@starthal
Copy link

starthal commented Dec 5, 2018

Description

Now that #886 allows the Dockerfile to be outside the build context, the man page is no longer correct.

Describe the results you received:

The docker-build man page says for --file:

If the path is a relative path and you are building from a local directory, then the path must be relative to that directory. If you are building from a remote URL pointing to either a tarball or a Git repository, then the path must be relative to the root of the remote context. In all cases, the file must be within the build context. The default is Dockerfile.

Describe the results you expected:

This should reflect the actual behavior. If I understand correctly, the path is actually relative to the directory in which docker build was run, not the build context dir specified in PATH. I don't know the rules for remote URLs.

Output of docker version:

Docker version 18.09.0, build 4d60db4
@starthal
Copy link
Author

starthal commented Dec 5, 2018

Looking through the man page, it also contains (emphasis mine)

This will read the Dockerfile from the directory specified in PATH. It also sends any other files and directories found in the current directory to the Docker daemon. The contents of this directory would be used by ADD commands found within the Dockerfile.

Which seems to conflict with the current docs:

The docker build command builds an image from a Dockerfile and a context. The build’s context is the set of files at a specified location PATH or URL. The PATH is a directory on your local filesystem. The URL is a Git repository location.

zvier pushed a commit to zvier/cli that referenced this issue Dec 9, 2018
zvier pushed a commit to zvier/cli that referenced this issue Dec 9, 2018
…Dockerfile path

Signed-off-by: zvier <liuzekun0524@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants