Skip to content

Commit 2bcc90a

Browse files
committed
revert: use default non-root user ubuntu introduced in Ubuntu 22.10
partial revert 9f9e965
1 parent 0e9105e commit 2bcc90a

File tree

3 files changed

+23
-18
lines changed

3 files changed

+23
-18
lines changed

contrib/containers/deploy/Dockerfile

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@ FROM phusion/baseimage:noble-1.0.0
22
LABEL maintainer="Dash Developers <dev@dash.org>"
33
LABEL description="Dockerised DashCore, built from CI"
44

5-
# Setup unprivileged user
6-
ARG USER_ID=1000 \
7-
GROUP_ID=1000
8-
RUN groupmod -g ${GROUP_ID} -n dash ubuntu; \
9-
usermod -u ${USER_ID} -md /home/dash -l dash ubuntu; \
10-
mkdir -p /home/dash/.dashcore && \
5+
ARG USER_ID
6+
ARG GROUP_ID
7+
8+
ENV HOME="/home/dash"
9+
10+
# add user with specified (or default) user/group ids
11+
ENV USER_ID="${USER_ID:-1000}"
12+
ENV GROUP_ID="${GROUP_ID:-1000}"
13+
RUN groupadd -g ${GROUP_ID} dash && \
14+
useradd -u ${USER_ID} -g dash -s /bin/bash -m -d /home/dash dash && \
15+
mkdir /home/dash/.dashcore && \
1116
chown ${USER_ID}:${GROUP_ID} -R /home/dash
1217

1318
COPY bin/* /usr/local/bin/

contrib/containers/deploy/Dockerfile.GitHubActions.Dispatch

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ ARG TAG
5252

5353
ENV HOME="/home/dash"
5454

55-
# Setup unprivileged user
56-
ARG USER_ID=1000 \
57-
GROUP_ID=1000
58-
RUN groupmod -g ${GROUP_ID} -n dash ubuntu; \
59-
usermod -u ${USER_ID} -md /home/dash -l dash ubuntu; \
60-
mkdir -p /home/dash/.dashcore && \
55+
# add user with specified (or default) user/group ids
56+
ENV USER_ID="${USER_ID:-1000}"
57+
ENV GROUP_ID="${GROUP_ID:-1000}"
58+
RUN groupadd -g ${GROUP_ID} dash && \
59+
useradd -u ${USER_ID} -g dash -s /bin/bash -m -d /home/dash dash && \
60+
mkdir /home/dash/.dashcore && \
6161
chown ${USER_ID}:${GROUP_ID} -R /home/dash
6262

6363
RUN apt-get update && \

contrib/containers/deploy/Dockerfile.GitHubActions.Release

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ ARG GITHUB_REPOSITORY
99

1010
ENV HOME /home/dash
1111

12-
# Setup unprivileged user
13-
ARG USER_ID=1000 \
14-
GROUP_ID=1000
15-
RUN groupmod -g ${GROUP_ID} -n dash ubuntu; \
16-
usermod -u ${USER_ID} -md /home/dash -l dash ubuntu; \
17-
mkdir -p /home/dash/.dashcore && \
12+
# add user with specified (or default) user/group ids
13+
ENV USER_ID ${USER_ID:-1000}
14+
ENV GROUP_ID ${GROUP_ID:-1000}
15+
RUN groupadd -g ${GROUP_ID} dash && \
16+
useradd -u ${USER_ID} -g dash -s /bin/bash -m -d /home/dash dash && \
17+
mkdir /home/dash/.dashcore && \
1818
chown ${USER_ID}:${GROUP_ID} -R /home/dash
1919

2020
RUN apt-get update && \

0 commit comments

Comments
 (0)