moby / moby/buildkit

Support for basic trailing comments

Open
#4,258 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

impact/dockerfile kind/enhancement
Dominant language
Go
Stars
10.3k
Forks
1.5k
Avg merge
1d 23h
Merged PRs (30d)
48

Description

Docker is rejecting trailing comments in FROM directives. Can we please make sure that comments are parsed better?

Some users are also noting that comments interact poorly with backslashed RUN directives. For that one, I'm not sure if Docker can provide a better behavior. But for simple FROM lines, Docker should definitely be able to handle trailing comments.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Dockerfile parser and tests covering FROM directives and backslashed RUN directives. Check how trailing comments are currently handled; done means simple trailing comments on FROM lines parse correctly, with the RUN behavior clarified by the existing tests or parser constraints.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, dockerfile, go
Domain
build-system, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.