Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
AnielAlexa authored Jul 9, 2024
1 parent 40cff3a commit 06e1174
Showing 1 changed file with 31 additions and 18 deletions.
49 changes: 31 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
# Base Image
#FROM nvidia/cuda:12.1.1-devel-ubuntu22.04
FROM dustynv/l4t-pytorch:r36.2.0
# Use ARG to set default values for base image and PyTorch installation command
ARG BASE_IMAGE=amd
ARG USER
ARG UID
ARG HOME
ARG WORKSPACE
ARG SHELL
ARG CONTAINER_NAME
ARG TIMEZONE=Etc/UTC

# Use conditionals to choose the base image
FROM nvidia/cuda:12.1.1-devel-ubuntu22.04 as amd
FROM dustynv/l4t-pytorch:r36.2.0 as arm

# Select the appropriate stage based on the BASE_IMAGE argument
FROM ${BASE_IMAGE}

# Arguments
ARG user
ARG uid
ARG home
ARG workspace
ARG shell
ARG container_name
ARG timezone=Etc/UTC
ARG USER
ARG UID
ARG HOME
ARG WORKSPACE
ARG SHELL
ARG CONTAINER_NAME
ARG TIMEZONE

# Environment Variables for noninteractive installation and timezone
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=${timezone}
ENV TZ=${TIMEZONE}

# Update and Install Essential Packages
RUN apt-get update && apt-get -y install --no-install-recommends \
tzdata apt-utils keyboard-configuration git curl wget ca-certificates screen tree sudo ssh synaptic aptitude gedit geany mesa-utils cmake build-essential python3-pip \
tzdata apt-utils keyboard-configuration git curl wget ca-certificates screen tree sudo ssh synaptic aptitude gedit geany mesa-utils cmake build-essential python3-pip \
libqt5widgets5 libqt5gui5 libqt5core5a libxcb-xinerama0 libfontconfig1 libxrender1 libx11-6 libxcb1 libxext6 libx11-xcb1 libxi6 libxrandr2 libgl1-mesa-glx libdbus-1-3 x11-apps librsvg2-common

# Symbolic link for Python
Expand All @@ -27,7 +40,10 @@ RUN ln -s /usr/bin/python3 /usr/bin/python
RUN pip install --upgrade pip && \
pip install matplotlib numpy kornia tqdm pyyaml termcolor scipy

#RUN pip install torch==2.1.1 torchvision==0.16.1 torchaudio==2.1.1 --index-url https://download.pytorch.org/whl/cu121
# Conditional installation of PyTorch for AMD architecture
RUN if [ "${BASE_IMAGE}" = "amd" ]; then \
pip install torch==2.1.1 torchvision==0.16.1 torchaudio==2.1.1 --index-url https://download.pytorch.org/whl/cu121; \
fi

# NVIDIA Container Runtime Configuration
ENV NVIDIA_VISIBLE_DEVICES ${NVIDIA_VISIBLE_DEVICES:-all}
Expand All @@ -41,10 +57,7 @@ ENV QT_X11_NO_MITSHM=1
ENV QT_QPA_PLATFORM_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms

# Set up working directories and clone relevant repositories
WORKDIR ${home}
WORKDIR ${HOME}
RUN git clone --branch ubuntu22_cuda --recursive https://github.com/AnielAlexa/pyslam.git
WORKDIR ${home}/pyslam
WORKDIR ${HOME}/pyslam
RUN git submodule update --init --recursive



0 comments on commit 06e1174

Please sign in to comment.