Skip to content

Commit 327b998

Browse files
authored
Merge pull request #41 from CCPBioSim/build-fix
change uid and gid of containers
2 parents 83f29c7 + c16ac05 commit 327b998

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

amber/Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,29 @@ LABEL maintainer="James Gebbie-Rayet <james.gebbie@stfc.ac.uk>"
55
ARG AIIDAVERSION=2.6.1
66
ARG AMBERTOOLSVERSION=24.8
77
ARG PYTHONVERSION=3.11
8+
ARG NEW_MAMBA_USER=aiida
9+
ARG NEW_MAMBA_USER_ID=1001
10+
ARG NEW_MAMBA_USER_GID=121
11+
USER root
12+
13+
RUN if grep -q '^ID=alpine$' /etc/os-release; then \
14+
# alpine does not have usermod/groupmod
15+
apk add --no-cache --virtual temp-packages shadow; \
16+
fi && \
17+
usermod "--login=${NEW_MAMBA_USER}" "--home=/home/${NEW_MAMBA_USER}" \
18+
--move-home "-u ${NEW_MAMBA_USER_ID}" "${MAMBA_USER}" && \
19+
groupmod "--new-name=${NEW_MAMBA_USER}" \
20+
"-g ${NEW_MAMBA_USER_GID}" "${MAMBA_USER}" && \
21+
if grep -q '^ID=alpine$' /etc/os-release; then \
22+
# remove the packages that were only needed for usermod/groupmod
23+
apk del temp-packages; \
24+
fi && \
25+
# Update the expected value of MAMBA_USER for the
26+
# _entrypoint.sh consistency check.
27+
echo "${NEW_MAMBA_USER}" > "/etc/arg_mamba_user" && \
28+
:
29+
ENV MAMBA_USER=$NEW_MAMBA_USER
30+
USER $MAMBA_USER
831

932
# Install dependencies
1033
RUN micromamba install -c conda-forge python=$PYTHONVERSION aiida-core=$AIIDAVERSION ambertools=$AMBERTOOLSVERSION && \

gromacs/Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,29 @@ LABEL maintainer="James Gebbie-Rayet <james.gebbie@stfc.ac.uk>"
55
ARG AIIDAVERSION=2.6.1
66
ARG GMXVERSION=2025.4
77
ARG PYTHONVERSION=3.11
8+
ARG NEW_MAMBA_USER=aiida
9+
ARG NEW_MAMBA_USER_ID=1001
10+
ARG NEW_MAMBA_USER_GID=121
11+
USER root
12+
13+
RUN if grep -q '^ID=alpine$' /etc/os-release; then \
14+
# alpine does not have usermod/groupmod
15+
apk add --no-cache --virtual temp-packages shadow; \
16+
fi && \
17+
usermod "--login=${NEW_MAMBA_USER}" "--home=/home/${NEW_MAMBA_USER}" \
18+
--move-home "-u ${NEW_MAMBA_USER_ID}" "${MAMBA_USER}" && \
19+
groupmod "--new-name=${NEW_MAMBA_USER}" \
20+
"-g ${NEW_MAMBA_USER_GID}" "${MAMBA_USER}" && \
21+
if grep -q '^ID=alpine$' /etc/os-release; then \
22+
# remove the packages that were only needed for usermod/groupmod
23+
apk del temp-packages; \
24+
fi && \
25+
# Update the expected value of MAMBA_USER for the
26+
# _entrypoint.sh consistency check.
27+
echo "${NEW_MAMBA_USER}" > "/etc/arg_mamba_user" && \
28+
:
29+
ENV MAMBA_USER=$NEW_MAMBA_USER
30+
USER $MAMBA_USER
831

932
# Install dependencies
1033
RUN micromamba install -c conda-forge python=$PYTHONVERSION aiida-core=$AIIDAVERSION gromacs=$GMXVERSION && \

0 commit comments

Comments
 (0)