From cab6ee910f0944cfe2f2844db6cb9b6228e6dfd7 Mon Sep 17 00:00:00 2001 From: Ruben Suarez Date: Sun, 7 Jun 2020 13:54:05 +0200 Subject: [PATCH] Set image tag as 18.04 On ubuntu:18.04 there is not a non-root "ubuntu" user --- .github/workflows/main.yml | 2 +- Dockerfile | 13 +------------ README.md | 8 ++++---- build-custom.sh | 2 +- build.sh | 2 +- run.sh | 2 +- 6 files changed, 9 insertions(+), 20 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8258afd..8484cb4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,5 +17,5 @@ jobs: with: DOCKER_REPOSITORY_NAME: rubensa DOCKER_IMAGE_NAME: ubuntu-tini-user - DOCKER_IMAGE_TAG: latest + DOCKER_IMAGE_TAG: 18.04 secrets: inherit diff --git a/Dockerfile b/Dockerfile index a34687e..49b9307 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM rubensa/ubuntu-tini +FROM rubensa/ubuntu-tini:18.04 LABEL author="Ruben Suarez " # Architecture component of TARGETPLATFORM (platform of the build result) @@ -16,17 +16,6 @@ ARG GROUP_NAME=group ENV USER_NAME=${USER_NAME} ENV GROUP_NAME=${GROUP_NAME} -# Since ubuntu:23.04 a non-root "ubuntu" user is created by default with UID=1000 -# Let's remove it to avoid conflicts -RUN echo "# Removing default 'ubuntu' user..." \ - # - # avoid "userdel: ubuntu mail spool (/var/mail/ubuntu) not found" warning - && touch /var/mail/ubuntu \ - && chown ubuntu /var/mail/ubuntu \ - # - # remove user - && userdel -r ubuntu - # Create a non-root user with custom group RUN echo "# Creating group '${GROUP_NAME}' (${GROUP_ID})..." \ && groupadd --gid ${GROUP_ID} ${GROUP_NAME} \ diff --git a/README.md b/README.md index 96db48f..ff5a1c3 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Docker image based on rubensa/ubuntu-tini with non root user support +# Docker image based on rubensa/ubuntu-tini 18.04 with non root user support This is a Docker image based on [rubensa/ubuntu-tini](https://github.com/rubensa/docker-ubuntu-tini) that allows you to connect and run with a non-root user created inside the image. @@ -13,7 +13,7 @@ You can build the image like this: DOCKER_REPOSITORY_NAME="rubensa" DOCKER_IMAGE_NAME="ubuntu-tini-user" -DOCKER_IMAGE_TAG="latest" +DOCKER_IMAGE_TAG="18.04" docker buildx build --platform=linux/amd64,linux/arm64 --no-cache \ -t "${DOCKER_REPOSITORY_NAME}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG}" \ @@ -32,7 +32,7 @@ You can also add build image args to change default non-root user (user:1000) an DOCKER_REPOSITORY_NAME="rubensa" DOCKER_IMAGE_NAME="ubuntu-tini-user" -DOCKER_IMAGE_TAG="latest" +DOCKER_IMAGE_TAG="18.04" # Get current user UID USER_ID=$(id -u) @@ -76,7 +76,7 @@ You can run the container like this (change --rm with -d if you don't want the c DOCKER_REPOSITORY_NAME="rubensa" DOCKER_IMAGE_NAME="ubuntu-tini-user" -DOCKER_IMAGE_TAG="latest" +DOCKER_IMAGE_TAG="18.04" # Get current user UID USER_ID=$(id -u) diff --git a/build-custom.sh b/build-custom.sh index 488015e..462e694 100755 --- a/build-custom.sh +++ b/build-custom.sh @@ -2,7 +2,7 @@ DOCKER_REPOSITORY_NAME="rubensa" DOCKER_IMAGE_NAME="ubuntu-tini-user" -DOCKER_IMAGE_TAG="latest" +DOCKER_IMAGE_TAG="18.04" # Get current user UID USER_ID=$(id -u) diff --git a/build.sh b/build.sh index 4ecc17f..73593bd 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ DOCKER_REPOSITORY_NAME="rubensa" DOCKER_IMAGE_NAME="ubuntu-tini-user" -DOCKER_IMAGE_TAG="latest" +DOCKER_IMAGE_TAG="18.04" # see: https://github.com/docker/buildx/issues/495#issuecomment-761562905 #docker buildx build --platform=linux/amd64,linux/arm64 --no-cache --progress=plain --pull \ diff --git a/run.sh b/run.sh index 9116ac2..549d9f9 100755 --- a/run.sh +++ b/run.sh @@ -2,7 +2,7 @@ DOCKER_REPOSITORY_NAME="rubensa" DOCKER_IMAGE_NAME="ubuntu-tini-user" -DOCKER_IMAGE_TAG="latest" +DOCKER_IMAGE_TAG="18.04" # Get current user UID USER_ID=$(id -u)