Skip to content

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

Open
docker/cli
#3424
@cristi8

Description

@cristi8
Contributor

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.

Activity

linked a pull request that will close this issue on Feb 12, 2022
cristi8

cristi8 commented on Mar 9, 2022

@cristi8
ContributorAuthor

This was opened more than 3 years ago. It's a simple false statement in the docs.

I even made a PR a month ago.

Why isn't this being fixed / PR merged?

docker-robott

docker-robott commented on Nov 30, 2022

@docker-robott
Collaborator

There hasn't been any activity on this issue for a long time.
If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment.
If not, this issue will be closed in 14 days. This helps our maintainers focus on the active issues.

Prevent issues from auto-closing with a /lifecycle frozen comment.

/lifecycle stale

cristi8

cristi8 commented on Dec 6, 2022

@cristi8
ContributorAuthor

/remove-lifecycle stale

The documentation still needs fixing

docker-robott

docker-robott commented on Mar 6, 2023

@docker-robott
Collaborator

There hasn't been any activity on this issue for a long time.
If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment.
If not, this issue will be closed in 14 days. This helps our maintainers focus on the active issues.

Prevent issues from auto-closing with a /lifecycle frozen comment.

/lifecycle stale

cristi8

cristi8 commented on Mar 6, 2023

@cristi8
ContributorAuthor

/remove-lifecycle stale

@nigelpoulton any news about this?

The documentation of docker build still needs fixing

nigelpoulton

nigelpoulton commented on Mar 6, 2023

@nigelpoulton
Contributor

@cristi8 I think this was incorrectly assigned to me. I'm not working on Docker docs.

docker-robott

docker-robott commented on Jun 4, 2023

@docker-robott
Collaborator

There hasn't been any activity on this issue for a long time.
If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment.
If not, this issue will be closed in 14 days. This helps our maintainers focus on the active issues.

Prevent issues from auto-closing with a /lifecycle frozen comment.

/lifecycle stale

6 remaining items

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

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

    Participants

    @thaJeztah@cristi8@nigelpoulton@paigehargrave@docker-robott

    Issue actions

      False statement about docker build's -f flag · Issue #8268 · docker/docs