Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfiles: update default user context #119

Merged
merged 1 commit into from
May 4, 2023
Merged

Conversation

nicoprow
Copy link
Contributor

@nicoprow nicoprow commented May 3, 2023

Match default user context with the default security context of the BPDM Pool and Gate Helm Charts.

Relevant Issue: #110

@nicoprow nicoprow requested a review from FaGru3n May 3, 2023 11:10
Copy link
Contributor

@FaGru3n FaGru3n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nicoprow nicoprow force-pushed the feat/docker/user-context branch from b5eaab2 to d1a7358 Compare May 3, 2023 11:41
@FaGru3n
Copy link
Contributor

FaGru3n commented May 4, 2023

Hi @nicoprow found out that it failed to build the docker file and i would suggest its depening on creating an system user (-S $USERNAME )with id over 100

ERROR: failed to solve: executor failed running [/bin/sh -c addgroup --gid $GID -S $USERNAME && adduser --uid $USERID --gid $GID -m $USERNAME]: exit code: 1
Error: buildx failed with: ERROR: failed to solve: executor failed running [/bin/sh -c addgroup --gid $GID -S $USERNAME && adduser --uid $USERID --gid $GID -m $USERNAME]: exit code: 1

Maybe you can adapt the example from auto-setup;
https://github.com/eclipse-tractusx/autosetup-backend/blob/4ca133ec4f3aa8df850ef7afdf3827b4f1550cd3/Dockerfile#LL39C1-L47C15

ARG USERNAME=bpdm
ARG USER_UID=100
ARG USER_GID=3000

# Create the user
RUN groupadd --gid $USER_GID $USERNAME \
    && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME 

USER $USERNAME

or just removing the -Sto prevent also changing the security context in your 'deploment.yaml'

@nicoprow nicoprow force-pushed the feat/docker/user-context branch from d1a7358 to ea0f6bf Compare May 4, 2023 10:05
@nicoprow
Copy link
Contributor Author

nicoprow commented May 4, 2023

Updated the groupadd and useradd commands to work with alpine distribution

@nicoprow nicoprow merged commit d0ce7de into main May 4, 2023
@nicoprow nicoprow deleted the feat/docker/user-context branch July 26, 2023 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants