diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 6a24dcf..302fc60 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -35,12 +35,6 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Get UID and GID - id: ids - run: | - echo "USER_UID=$(id -u)" >> $GITHUB_ENV - echo "USER_GID=$(id -g)" >> $GITHUB_ENV - - name: Build and push Docker image uses: docker/build-push-action@v5.3.0 with: @@ -48,5 +42,5 @@ jobs: push: true tags: ghcr.io/${{ env.OWNER_LC }}/${{ github.event.repository.name }}:latest build-args: | - USER_UID=${{ env.USER_UID }} - USER_GID=${{ env.USER_GID }} + USER_UID=1000 + USER_GID=1000 diff --git a/Dockerfile b/Dockerfile index f06b11a..61aa16d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,13 +13,7 @@ ARG USER_UID=1000 ARG USER_GID=1000 # Check if the GID is already in use, if so, find an available GID -RUN if getent group $USER_GID; then \ - USER_GID=$(getent group | awk -F: '{if ($3 >= 1000) print $3}' | sort -n | tail -1 | awk '{print $1+1}'); \ - fi && \ - if getent passwd $USER_UID; then \ - USER_UID=$(getent passwd | awk -F: '{if ($3 >= 1000) print $3}' | sort -n | tail -1 | awk '{print $1+1}'); \ - fi && \ - addgroup -g $USER_GID $USERNAME && \ +RUN addgroup -g $USER_GID $USERNAME && \ adduser --disabled-password -u $USER_UID -G $USERNAME $USERNAME && \ addgroup $USERNAME docker