-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
37 lines (36 loc) · 1.83 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# This is our first build stage, it will not persist in the final image
FROM ubuntu as intermediate
RUN apt-get -y update && apt-get install -y git
ARG SSH_PRIVATE_KEY
RUN mkdir /root/.ssh/
RUN echo "${SSH_PRIVATE_KEY}" > /root/.ssh/id_rsa
RUN chmod 400 /root/.ssh/id_rsa
# Make sure your domain is accepted
RUN touch /root/.ssh/known_hosts
RUN ssh-keyscan github.com >> /root/.ssh/known_hosts
# Download the computer vision framework
RUN git clone [email protected]:pcr-upm/images_framework.git images_framework
RUN git clone [email protected]:pcr-upm/opal23_headpose.git images_framework/alignment/opal23_headpose
ADD data /images_framework/alignment/opal23_headpose/data
# Copy the repository from the previous image
FROM nvcr.io/nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04
ENV LANG=C.UTF-8
ENV TZ=Europe/Madrid
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get -y update && apt-get install -y build-essential wget libgl1-mesa-glx libsm6 libxext6 libglib2.0-0
RUN mkdir /home/username
WORKDIR /home/username
COPY --from=intermediate /images_framework /home/username/images_framework
LABEL maintainer="[email protected]"
# Setup conda environment
RUN wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /home/username/miniconda.sh
RUN chmod +x /home/username/miniconda.sh
RUN /home/username/miniconda.sh -b -p /home/username/conda
RUN /home/username/conda/bin/conda create --name opal23 python=3.10
# Activate conda environment
ENV PATH /home/username/conda/envs/opal23/bin:/home/username/conda/bin:$PATH
# Make RUN commands use the new environment (source activate opal23)
SHELL ["conda", "run", "-n", "opal23", "/bin/bash", "-c"]
# Install dependencies
RUN pip install tqdm Pillow numpy opencv-python rasterio scipy
RUN pip install torch==1.13.0+cu117 --extra-index-url https://download.pytorch.org/whl/cu117