fix: create extra groups before system setup
This avoids conflict with system groups.
This commit is contained in:
parent
4053044c33
commit
90131929b5
18
Dockerfile
18
Dockerfile
@ -1,10 +1,18 @@
|
|||||||
FROM ubuntu:mantic-20240216
|
FROM ubuntu:mantic-20240216
|
||||||
|
|
||||||
# system deps
|
# user setup
|
||||||
ARG USER_UID=1000
|
ARG USER_UID=1000
|
||||||
ARG USER_GID=1000
|
ARG USER_GID=1000
|
||||||
ARG DOCKER_GID=999
|
ARG DOCKER_GID=999
|
||||||
ARG WHEEL_GID=980
|
ARG WHEEL_GID=980
|
||||||
|
RUN echo 'remove existing ubuntu user' \
|
||||||
|
&& groupdel --force ubuntu \
|
||||||
|
&& userdel --force ubuntu \
|
||||||
|
&& echo 'setup extra groups' \
|
||||||
|
&& groupadd --gid ${WHEEL_GID} wheel \
|
||||||
|
&& groupadd --gid ${DOCKER_GID} docker
|
||||||
|
|
||||||
|
# system deps
|
||||||
ENV DEBIAN_FRONTEND noninteractive
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y software-properties-common \
|
&& apt-get install -y software-properties-common \
|
||||||
@ -83,15 +91,7 @@ RUN apt-get update \
|
|||||||
zlib1g-dev \
|
zlib1g-dev \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
&& locale-gen en_US.UTF-8 \
|
&& locale-gen en_US.UTF-8 \
|
||||||
&& echo 'remove existing ubuntu user' \
|
|
||||||
&& groupdel --force ubuntu \
|
|
||||||
&& userdel --force ubuntu \
|
|
||||||
&& echo 'update gid from systemd-journal group' \
|
|
||||||
&& groupmod -g 994 systemd-journal \
|
|
||||||
&& chgrp --recursive systemd-journal /var/log/journal \
|
|
||||||
&& echo 'setup unprivileged user' \
|
&& echo 'setup unprivileged user' \
|
||||||
&& groupadd --gid ${WHEEL_GID} wheel \
|
|
||||||
&& groupadd --gid ${DOCKER_GID} docker \
|
|
||||||
&& groupadd --gid ${USER_GID} coder \
|
&& groupadd --gid ${USER_GID} coder \
|
||||||
&& useradd \
|
&& useradd \
|
||||||
--uid ${USER_UID} \
|
--uid ${USER_UID} \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user