Skip to content

Commit 8a3ece7

Browse files
committed
Move dropping root permissions to after apk adds
1 parent 45fdd84 commit 8a3ece7

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ ARG UID=1000
99
ARG GID=1000
1010
ENV USERNAME=rgpeach10
1111
RUN adduser -D -u ${UID} -g ${GID} ${USERNAME}
12-
USER ${USERNAME}
13-
WORKDIR /home/${USERNAME}
14-
ENV HOME=/home/${USERNAME}
1512

1613
# Stable repos first, edge as fallback for packages not yet in stable
1714
# Stable repos first
@@ -104,7 +101,6 @@ RUN apk add --no-cache --repositories-file /etc/apk/repositories.edge \
104101
ENV PATH="/home/${USERNAME}/.cargo/bin:$PATH"
105102

106103
# uv installs
107-
ENV PATH="$HOME/.local/bin:$PATH"
108104
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
109105
RUN apk --no-cache --virtual .build-deps add \
110106
gcc \
@@ -142,6 +138,12 @@ RUN apk --no-cache --virtual .build-deps add \
142138
uv tool install --verbose thefuck && \
143139
uv tool install --verbose ansible
144140

141+
# Drop root permissions
142+
USER ${USERNAME}
143+
WORKDIR /home/${USERNAME}
144+
ENV HOME=/home/${USERNAME}
145+
ENV PATH="$HOME/.local/bin:$PATH"
146+
145147
# npm installs
146148
RUN npm install -g \
147149
prettier \

0 commit comments

Comments
 (0)