8000 duplicate path in $PATH · Issue #899 · docker-library/python · GitHub
[go: up one dir, main page]

Skip to content
duplicate path in $PATH #899
Open
Open
@dotysan

Description

@dotysan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0