apt-get pinning not possible with wildcards in RUN statements
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- docker
- Domain
- documentation
Research direction
Open the Docker documentation best-practices page and inspect the #run section and its apt-get example. Reproduce the reported Dockerfile command and compare it with the manual shell behavior, then update the documentation so the version-pinning example accurately reflects supported behavior and verify the rendered example is clear.
Written by the indexing model from the issue text.
Description
Is this a docs issue?
- My issue is about the documentation content or website
Type of issue
Information is incorrect
Description
Specifically in the #run section of the documentation.
https://docs.docker.com/build/building/best-practices/#run
Documentation shows a * character implying that a wildcard is possible with apt-get.
RUN apt-get update && apt-get install -y --no-install-recommends \
s3cmd=1.1.* \
&& rm -rf /var/lib/apt/lists/*
This is not currently possible inside the RUN command as it uses sh and some string multiline configuration.
8.960 Package curl is not available, but is referred to by another package.
8.960 This may mean that the package is missing, has been obsoleted, or
8.960 is only available from another source
8.960
8.961 E: Version '8.5.*' for 'curl' was not found
------
test.Dockerfile:3
--------------------
3 | >>> RUN apt-get update && apt-get install -y --no-install-recommends \
4 | >>> curl=8.5.* \
5 | >>> && rm -rf /var/lib/apt/lists/*
ERROR: failed to build: failed to solve: process "/bin/sh -c apt-get update && apt-get install -y --no-install-recommends curl=8.5.* && rm -rf /var/lib/apt/lists/*" did not complete successfully: exit code: 100
If you run it manually inside a container via bash/sh it seems to work.
$ apt-get install -y --no-install-recommends curl=8.5.*
Tried these as well but they fail for a different syntax/space reason.
/bin/sh -c apt-get update && apt-get install -y --no-install-recommends curl=8.5.* && rm -rf /var/lib/apt/lists/*
root@765e66383567:/app# /bin/sh -c apt-get update && apt-get install -y --no-install-recommends \
> curl=8.5.* \
> && rm -rf /var/lib/apt/lists/*
Location
https://docs.docker.com/build/building/best-practices/
Suggestion
No response
- Dominant language
- Markdown
- Stars
- 4.7k
- Forks
- 8.5k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 104
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from docker/docs
-
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
status/triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
area/dhi status/triage
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
agilepathway/label-checker#640 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
BasedHardware/omi#15662 · 1 comment ·
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
amponce/archive-movie-browser#167 ·
-
user-reported
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Kong/developer.konghq.com#7316 ·