Skip to content

False statement about docker build's -f flag #8268

Open
docker/cli
#3424
@cristi8

Description

@cristi8

File: engine/reference/commandline/build.md

The documentation about docker build's "-f" flag mentions the following:
If a relative path is specified then it is interpreted as relative to the root of the context.
This is false and misleading. It looks like if a relative path is specified, it is searched as being relative to the current directory, not the root of the context.

An example of the correct usage is also on the same page, when it mentions that the two docker build commands do the same thing:

$ cd /home/me/myapp/some/dir/really/deep
$ docker build -f /home/me/myapp/dockerfiles/debug /home/me/myapp
$ docker build -f ../../../../dockerfiles/debug /home/me/myapp

It is visible there that the second docker build uses a relative path that is relative to the current directory, not the root of the context.

Metadata

Metadata

Assignees

Labels

area/buildRelates to Dockerfiles or docker build commandarea/engineIssue affects Docker engine/daemonlifecycle/frozen

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions