Skip to content

Commit

Permalink
chore: upgrade dockerfile ubuntu version
Browse files Browse the repository at this point in the history
  • Loading branch information
MoisesGSalas committed Sep 15, 2024
1 parent d6dd834 commit 2bf1d8a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:focal
FROM ubuntu:noble
SHELL ["/bin/bash", "-c"]

ARG python_version=3.8
Expand All @@ -15,7 +15,7 @@ RUN pip install virtualenv

# Define Environment Variables
ENV CODEJAIL_GROUP=sandbox
ENV CODEJAIL_SANDBOX_CALLER=ubuntu
ENV CODEJAIL_SANDBOX_CALLER=codejail
ENV CODEJAIL_TEST_USER=sandbox
ENV CODEJAIL_TEST_VENV=/home/sandbox/codejail_sandbox-python${python_version}

Expand All @@ -33,8 +33,8 @@ RUN addgroup $CODEJAIL_GROUP
RUN adduser --disabled-login --disabled-password $CODEJAIL_TEST_USER --ingroup $CODEJAIL_GROUP

# Switch to non root user inside Docker container
RUN addgroup ubuntu
RUN adduser --disabled-login --disabled-password ubuntu --ingroup ubuntu
RUN addgroup $CODEJAIL_SANDBOX_CALLER
RUN adduser --disabled-login --disabled-password $CODEJAIL_SANDBOX_CALLER --ingroup $CODEJAIL_SANDBOX_CALLER

# Give Ownership of sandbox env to sandbox group and user
RUN chown -R $CODEJAIL_TEST_USER:$CODEJAIL_GROUP $CODEJAIL_TEST_VENV
Expand All @@ -61,7 +61,7 @@ COPY sudoers-file/01-sandbox-python-${python_version} /etc/sudoers.d/01-sandbox
RUN chmod 0440 /etc/sudoers.d/01-sandbox

# Change Repo ownership
RUN chown -R ubuntu:ubuntu ../codejail
RUN chown -R $CODEJAIL_SANDBOX_CALLER:$CODEJAIL_SANDBOX_CALLER ../codejail

# Switch to ubuntu user
USER ubuntu
USER $CODEJAIL_SANDBOX_CALLER

0 comments on commit 2bf1d8a

Please sign in to comment.