docker update
This commit is contained in:
@@ -0,0 +1,46 @@
|
|||||||
|
# Use an existing image as the base
|
||||||
|
FROM nvcr.io/nvidia/pytorch:23.04-py3
|
||||||
|
# FROM pytorch/pytorch:1.13.1-cuda11.6-cudnn8-devel
|
||||||
|
# FROM pytorch/pytorch:2.0.0-cuda11.7-cudnn8-devel
|
||||||
|
#
|
||||||
|
# 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 apt-utils htop
|
||||||
|
|
||||||
|
# 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 /workspace
|
||||||
|
|
||||||
|
ENV PATH="$PATH:/home/$USER_NAME/.local/bin"
|
||||||
|
RUN pip install --upgrade pip
|
||||||
|
COPY requirements.txt /tmp/
|
||||||
|
RUN pip install --requirement /tmp/requirements.txt
|
||||||
|
RUN pip install torch-cluster -f https://data.pyg.org/whl/torch-2.0.0+cu117.html
|
||||||
|
|
||||||
|
|
||||||
|
# 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"]
|
||||||
@@ -19,3 +19,24 @@ services:
|
|||||||
reservations:
|
reservations:
|
||||||
devices:
|
devices:
|
||||||
- capabilities: [gpu]
|
- capabilities: [gpu]
|
||||||
|
|
||||||
|
|
||||||
|
lhunor_torch_2:
|
||||||
|
image: lhunor_torch:nv23.04
|
||||||
|
container_name: lhunor_torch_nv23.04
|
||||||
|
ipc: host
|
||||||
|
tty: true
|
||||||
|
ulimits:
|
||||||
|
memlock: -1
|
||||||
|
stack: 67108864
|
||||||
|
volumes:
|
||||||
|
- '/home-net/lhunor:/home-net'
|
||||||
|
- '/data-net/guest/lhunor/data:/data-net'
|
||||||
|
- '/data-fast/126-data1/lhunor/data:/data-local/126'
|
||||||
|
- '/data-fast/127-data1/lhunor/data:/data-local/127'
|
||||||
|
- '/data-fast/128-data1/lhunor/data:/data-local/128'
|
||||||
|
deploy:
|
||||||
|
resources:
|
||||||
|
reservations:
|
||||||
|
devices:
|
||||||
|
- capabilities: [gpu]
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
torch==2.0.0
|
||||||
numpy
|
numpy
|
||||||
matplotlib
|
matplotlib
|
||||||
opencv-python
|
opencv-python
|
||||||
|
|||||||
Reference in New Issue
Block a user