Docker: T5400: ensure OPAM environment is always present

This commit is contained in:
Christian Breunig 2025-03-07 14:15:40 +01:00
parent f23b204e68
commit b8f99c7547
2 changed files with 3 additions and 2 deletions

View File

@ -368,7 +368,7 @@ RUN sed "s/^%sudo.*/%sudo\tALL=(ALL) NOPASSWD:ALL/g" -i /etc/sudoers && \
chmod a+s /usr/sbin/useradd /usr/sbin/groupadd
# Ensure sure all users have access to our OCAM and Go installation
RUN echo "$(opam env --root=/opt/opam --set-root)" >> /etc/skel/.bashrc && \
RUN echo "eval \$(opam env --root=/opt/opam --set-root)" >> /etc/skel/.bashrc && \
echo "export PATH=/opt/go/bin:\$PATH" >> /etc/skel/.bashrc
# Rise upper limit for UID when working in an Active Direcotry integrated

View File

@ -24,7 +24,8 @@ if ! grep -q $NEW_GID /etc/group; then
fi
useradd --shell /bin/bash --uid $NEW_UID --gid $NEW_GID --non-unique --create-home $USER_NAME
sudo chown $NEW_UID:$NEW_GID /home/$USER_NAME
sudo cp /etc/skel/.* /home/$USER_NAME
sudo chown -R $NEW_UID:$NEW_GID /home/$USER_NAME
export HOME=/home/$USER_NAME
if [ "$(id -u)" == "0" ]; then