docker-library / docker-library/python
duplicate path in $PATH
Nobody has claimed this yet.
- Dominant language
- Dockerfile
- Stars
- 2.8k
- Forks
- 1.1k
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 1
Description
Minor nit. We blindly prepend /usr/local/bin onto the $PATH without looking to see if it's already there. This leads to duplication.
docker run --rm -it python:3.12-slim
Python 3.12.1 (main, Jan 11 2024, 10:03:43) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.environ['PATH']
'/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
Expected output: /usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin
Or possibly the original path is fine? Since /usr/local/sbin already occurs before /usr/bin and /bin.
This applies to all the base images in here. They all come with PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin for the root user.
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Start by searching the repository for where PATH is defined for the Python base images, then compare that value with the environment shown by the provided docker run and Python commands. Done means the affected images no longer duplicate /usr/local/bin while preserving the expected path order.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100