Skip to content

Dockerfile fails to build when UID/GID matches with the existing docker image user #28

@arntanguy

Description

@arntanguy

My host user has uid 1000 and gid 100. A user ubuntu with the same id already existing within the osrf/ros:jazzy-desktop image, causing this command to fail

RUN groupadd --gid $USER_GID $USERNAME \
    && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
    && mkdir -p -m 0700 /run/user/"${USER_UID}" \
    && mkdir -p -m 0700 /run/user/"${USER_UID}"/gdm \
    && chown user:user /run/user/"${USER_UID}" \
    && chown user:user /workspaces \
    && chown user:user /run/user/"${USER_UID}"/gdm

The following works for me, but is not a clean fix:

ARG USERNAME=ubuntu
RUN mkdir -p -m 0700 /run/user/"${USER_UID}" \
    && mkdir -p -m 0700 /run/user/"${USER_UID}"/gdm \
    && chown user:user /run/user/"${USER_UID}" \
    && chown user:user /workspaces \
    && chown user:user /run/user/"${USER_UID}"/gdm

Would you consider publishing a repo with urdf files pre-generated (by CI)? This is quite uncommon to have a description package that does not provide ready-to-use urdf files, and even more uncommon to rely on docker to generate them.

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