-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile-dev
68 lines (51 loc) · 2.31 KB
/
Dockerfile-dev
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
FROM nvidia/cuda:11.7.1-cudnn8-runtime-ubuntu20.04
ARG DEBIAN_FRONTEND=noninteractive
# Install dependencies
RUN apt-get update && apt-get install -y \
curl \
sudo \
wget \
libxml2 \
git \
xdg-utils \
libjpeg-turbo8 \
libgl1 -y
# last two not installed by conda for some reason for opencv
# Set environment variables
ENV PATH="/root/mambaforge/bin:$PATH"
# Install GitHub CLI
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& apt-get update \
&& apt-get -y install gh
# Install Conda
RUN wget https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh \
&& bash Mambaforge-Linux-x86_64.sh -b \
&& rm Mambaforge-Linux-x86_64.sh \
&& echo 'export PATH="/root/mambaforge/bin:$PATH"' >> ~/.bashrc
# Install Conda packages for jupyter server
RUN mamba install -n base -c conda-forge jupyterlab_widgets jupyterlab nb_conda_kernels ipywidgets black isort -y
##### Install custom Conda packages
# Copy the environment.yaml file to the image
COPY environment.yaml /
# allows installation if cuda not on host, vague explanation
# here: https://conda-forge.org/docs/maintainer/knowledge_base.html#cuda-builds
ENV CONDA_OVERRIDE_CUDA=11.7
# Create a new conda environment based on the environment.yaml file
RUN mamba env create -f /environment.yaml --quiet
# Activate the new environment
SHELL ["conda", "run", "-n", "segment-geo", "/bin/bash", "-c"]
# # Log in to Weights and Biases
# RUN wandb login
# Set the working directory to /slickformer
WORKDIR /segment-anything-geo
# Set the volume to mount the local directory where the Dockerfile is in
VOLUME /segment-anything-geo
# Copy the library file to the image
# COPY python-module/ /segment-anything-geo
# COPY setup.py /segment-anything-geo
# RUN pip install -e .
# so we can activate envs in vscode remote container connection
RUN conda init
# Start Jupyter Lab
CMD ["/bin/bash", "-c", "jupyter lab --allow-root --no-browser --ip 0.0.0.0 --port 8888 --notebook-dir=/segment-anything-services"]