From 19c60925803a7bdb8d9682e9dcc6a989d927b6d4 Mon Sep 17 00:00:00 2001 From: Sebastian <sebastian.karius@informatik.uni-halle.de> Date: Wed, 12 Feb 2025 15:17:10 +0100 Subject: [PATCH] switch to preinstalled ubuntu user --- docker/coder-ubuntu_24-python/Dockerfile | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/docker/coder-ubuntu_24-python/Dockerfile b/docker/coder-ubuntu_24-python/Dockerfile index 3aecd41..3b195c9 100644 --- a/docker/coder-ubuntu_24-python/Dockerfile +++ b/docker/coder-ubuntu_24-python/Dockerfile @@ -1,8 +1,6 @@ FROM ubuntu:24.04 LABEL authors="sebastian" -SHELL ["/bin/bash", "-c"] - ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get upgrade -y @@ -42,23 +40,21 @@ RUN apt-get install -y htop \ pv \ brotli -# create coder user -RUN useradd -ms /bin/bash coder -RUN usermod -aG sudo coder - -# allow sudo without password -RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers - # clean up RUN apt-get clean RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* -# switch to coder user -USER coder -WORKDIR /home/coder +# add ubuntu user to sudo +RUN usermod -aG sudo ubuntu + +# allow sudo without password +RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +# switch to ubuntu user +USER ubuntu +WORKDIR /home/ubuntu # activate miniconda -RUN source /opt/miniconda3/bin/activate RUN /opt/miniconda3/bin/conda init --all ENV PATH="${PATH}:/opt/miniconda3/bin" @@ -66,7 +62,7 @@ ENV PATH="${PATH}:/opt/miniconda3/bin" ENV PATH="${PATH}:/opt/poetry/bin" # add .local/bin to PATH to be able to directly call python modules installed by pipx -ENV PATH="${PATH}:/home/coder/.local/bin" +ENV PATH="${PATH}:/home/ubuntu/.local/bin" # prevent tensorflow from allocation all vram ENV TF_FORCE_GPU_ALLOW_GROWTH=true -- GitLab