From 6e551b5ea005eef3e17620dc05645349a9472956 Mon Sep 17 00:00:00 2001 From: Paul Haesler Date: Tue, 20 Aug 2024 15:12:05 +1000 Subject: [PATCH] Delete the ubuntu user so ows gets 1000. --- Dockerfile | 1 + docker-compose.yaml | 4 ++-- docker/files/remap-user.sh | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index b88c3ffba..aa7528735 100644 --- a/Dockerfile +++ b/Dockerfile @@ -69,6 +69,7 @@ RUN EXTRAS=$([ "$ENVIRONMENT" = "deployment" ] || echo ",test") && \ python3-pip)) # Configure user +RUN userdel -r ubuntu RUN useradd -m -s /bin/bash ows WORKDIR "/home/ubuntu" diff --git a/docker-compose.yaml b/docker-compose.yaml index d45459bc2..9fdf0f6ef 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -12,8 +12,8 @@ services: # Uncomment for use with non-dockerised postgres (for docker-compose 1.x) # network_mode: host environment: - LOCAL_UID: ${LOCAL_UID:-1001} - LOCAL_GID: ${LOCAL_GID:-1001} + LOCAL_UID: ${LOCAL_UID:-1000} + LOCAL_GID: ${LOCAL_GID:-1000} # Defaults are defined in .env file AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID} AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY} diff --git a/docker/files/remap-user.sh b/docker/files/remap-user.sh index c725a2f9b..8f5826295 100755 --- a/docker/files/remap-user.sh +++ b/docker/files/remap-user.sh @@ -4,8 +4,8 @@ # If $LOCAL_UID or $LOCAL_GID are not set, they default to 1001 (default # for the first user created in Ubuntu). -USER_ID=${LOCAL_UID:-1001} -GROUP_ID=${LOCAL_GID:-1001} +USER_ID=${LOCAL_UID:-1000} +GROUP_ID=${LOCAL_GID:-1000} OWS_ID=$(id -u ows) [[ "$USER_ID" == "$OWS_ID" ]] || usermod -u $USER_ID -o -m -d /home/ows ows