Commit
·
dcfc6f9
1
Parent(s):
28f236c
try again
Browse files- Dockerfile +9 -13
Dockerfile
CHANGED
|
@@ -3,31 +3,27 @@
|
|
| 3 |
|
| 4 |
FROM ghcr.io/cmu-sei/pharos:pichash-work
|
| 5 |
|
| 6 |
-
RUN apt-get -y update && apt-get -y install python3-pip python-is-python3
|
| 7 |
-
|
| 8 |
WORKDIR /code
|
| 9 |
|
| 10 |
COPY ./requirements.txt /code/requirements.txt
|
| 11 |
|
| 12 |
-
RUN
|
| 13 |
-
|
| 14 |
-
# Set up a new user named "user" with user ID 1000
|
| 15 |
-
RUN useradd -m -u 1000 user
|
| 16 |
|
| 17 |
# Switch to the "user" user
|
| 18 |
-
USER
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
# Set home to the user's home directory
|
| 21 |
-
ENV HOME=/home/
|
| 22 |
-
PATH=/home/
|
| 23 |
|
| 24 |
# Set the working directory to the user's home directory
|
| 25 |
WORKDIR $HOME/app
|
| 26 |
|
| 27 |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 28 |
-
COPY --chown=
|
| 29 |
-
|
| 30 |
-
# Disable buffering to allow logging of standard output.
|
| 31 |
-
ENV PYTHONUNBUFFERED=1
|
| 32 |
|
| 33 |
CMD ["python", "main.py"]
|
|
|
|
| 3 |
|
| 4 |
FROM ghcr.io/cmu-sei/pharos:pichash-work
|
| 5 |
|
|
|
|
|
|
|
| 6 |
WORKDIR /code
|
| 7 |
|
| 8 |
COPY ./requirements.txt /code/requirements.txt
|
| 9 |
|
| 10 |
+
RUN apt-get -y update && apt-get -y install python3-pip python-is-python3
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
# Switch to the "user" user
|
| 13 |
+
USER ubuntu
|
| 14 |
+
|
| 15 |
+
RUN pip install --break-system-packages --no-cache-dir --upgrade setuptools pip
|
| 16 |
+
|
| 17 |
+
RUN pip install --break-system-packages --no-cache-dir --upgrade -r /code/requirements.txt
|
| 18 |
|
| 19 |
# Set home to the user's home directory
|
| 20 |
+
ENV HOME=/home/ubuntu \
|
| 21 |
+
PATH=/home/ubuntu/.local/bin:$PATH
|
| 22 |
|
| 23 |
# Set the working directory to the user's home directory
|
| 24 |
WORKDIR $HOME/app
|
| 25 |
|
| 26 |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 27 |
+
COPY --chown=ubuntu . $HOME/app
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
CMD ["python", "main.py"]
|