Skip to content

Instantly share code, notes, and snippets.

@roman4ello
Last active October 2, 2023 10:49
Show Gist options
  • Select an option

  • Save roman4ello/4ba42a2a8bb160f2ca9ca74cacb2beea to your computer and use it in GitHub Desktop.

Select an option

Save roman4ello/4ba42a2a8bb160f2ca9ca74cacb2beea to your computer and use it in GitHub Desktop.

Revisions

  1. roman4ello revised this gist Oct 2, 2023. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    FROM amazoncorretto:8u382-alpine-jre

    ARG USER_ID=YOUR_USER_ID
    ARG GROUP_ID=YOUR_GROUP_ID
    ARG USER_NAME=YOUR_USER
  2. roman4ello created this gist Oct 2, 2023.
    15 changes: 15 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    ARG USER_ID=YOUR_USER_ID
    ARG GROUP_ID=YOUR_GROUP_ID
    ARG USER_NAME=YOUR_USER
    ARG GROUP_NAME=YOUR_GROUP

    RUN set -x && addgroup -g $GROUP_ID $GROUP_NAME && \
    adduser --shell /sbin/nologin \
    --disabled-password \
    --gecos '' \
    --no-create-home \
    --uid $USER_ID \
    --ingroup $GROUP_NAME \
    $USER_NAME && set +x

    USER $USER_NAME