From ba24dca22c36f50e4fe2ce081ada946d8e7279a0 Mon Sep 17 00:00:00 2001 From: Hunor Laczko Date: Thu, 30 Mar 2023 14:13:53 +0000 Subject: [PATCH] update dockerfile --- docker/Dockerfile | 16 +++---- docker/Dockerfile_old | 42 +++++++++++++++++++ .../{requierements.txt => requirements.txt} | 4 -- 3 files changed, 50 insertions(+), 12 deletions(-) create mode 100644 docker/Dockerfile_old rename docker/{requierements.txt => requirements.txt} (52%) diff --git a/docker/Dockerfile b/docker/Dockerfile index 2641a78..cd5d9f3 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,7 +1,5 @@ -FROM tensorflow/tensorflow:2.9.0-gpu - -RUN apt-get update -RUN apt-get upgrade -y +# Use an existing image as the base +FROM nvcr.io/nvidia/pytorch:23.03-py3 # Add the current user to the image ARG USER_NAME=lhunor @@ -10,7 +8,7 @@ ARG GROUP_NAME=guest ARG GROUP_ID=11000 # Update the system and install required packages -RUN apt-get update && apt-get upgrade -y && apt-get install -y sudo git +RUN apt-get update && apt-get upgrade -y && apt-get install -y sudo git apt-utils # Create a new group with the same GID as the host RUN groupadd --gid $GROUP_ID $GROUP_NAME @@ -28,10 +26,12 @@ RUN usermod -aG sudo $USER_NAME # Set the default user to the new user USER $USER_NAME -WORKDIR //home-net +WORKDIR /workspace -RUN apt-get install git ffmpeg libsm6 libxext6 libopenexr-dev zip unzip htop nano -y -RUN pip install numpy matplotlib opencv-python wandb OpenEXR tensorflow-graphics scipy plotly pandas tensorboardX opencv-python cmapy +ENV PATH="$PATH:/home/$USER_NAME/.local/bin" +RUN pip install --upgrade pip +COPY requirements.txt /tmp/ +RUN pip install --requirement /tmp/requirements.txt # defining the volumes that will be mounted VOLUME [ "/data-net" ] diff --git a/docker/Dockerfile_old b/docker/Dockerfile_old new file mode 100644 index 0000000..2641a78 --- /dev/null +++ b/docker/Dockerfile_old @@ -0,0 +1,42 @@ +FROM tensorflow/tensorflow:2.9.0-gpu + +RUN apt-get update +RUN apt-get upgrade -y + +# Add the current user to the image +ARG USER_NAME=lhunor +ARG USER_ID=11017 +ARG GROUP_NAME=guest +ARG GROUP_ID=11000 + +# Update the system and install required packages +RUN apt-get update && apt-get upgrade -y && apt-get install -y sudo git + +# Create a new group with the same GID as the host +RUN groupadd --gid $GROUP_ID $GROUP_NAME + +# Create a new user with the same UID and GID as the host +RUN useradd --uid $USER_ID --gid $GROUP_ID --shell /bin/bash --create-home $USER_NAME + +# don't require password with sudo, for convenience +# not the safest thing to do, but hopefully okay inside the container +RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +# Add the new user to the sudo group +RUN usermod -aG sudo $USER_NAME + +# Set the default user to the new user +USER $USER_NAME + +WORKDIR //home-net + +RUN apt-get install git ffmpeg libsm6 libxext6 libopenexr-dev zip unzip htop nano -y +RUN pip install numpy matplotlib opencv-python wandb OpenEXR tensorflow-graphics scipy plotly pandas tensorboardX opencv-python cmapy + +# defining the volumes that will be mounted +VOLUME [ "/data-net" ] +VOLUME [ "/data-local" ] +VOLUME [ "/home-net" ] + +# Start the container with a bash shell +CMD ["/bin/bash"] \ No newline at end of file diff --git a/docker/requierements.txt b/docker/requirements.txt similarity index 52% rename from docker/requierements.txt rename to docker/requirements.txt index 64e5458..a7754b8 100644 --- a/docker/requierements.txt +++ b/docker/requirements.txt @@ -2,11 +2,7 @@ numpy matplotlib opencv-python wandb -OpenEXR -tensorflow-graphics scipy plotly pandas -tensorboardX -opencv-python cmapy \ No newline at end of file