-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
try to cut down size of Docker container
- Loading branch information
Showing
2 changed files
with
15 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.git | ||
.dockerignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,27 @@ | ||
FROM continuumio/miniconda3:4.9.2-alpine | ||
LABEL authors="" \ | ||
version="2.1.2" \ | ||
LABEL version="2.1.2" \ | ||
description="Docker image for Pangolin" | ||
|
||
# Install git for pangolin | ||
RUN apk update && \ | ||
apk add git bash | ||
|
||
COPY environment.yml /environment.yml | ||
# Python 3.8.5 already installed along with recent version of pip | ||
# so remove Python and pip deps from environment.yml before installation | ||
RUN sed -i "$(grep -n python=3.7 /environment.yml | cut -f1 -d:)d" /environment.yml && \ | ||
sed -i "$(grep -n pip= /environment.yml | cut -f1 -d:)d" /environment.yml | ||
# Install the conda environment | ||
COPY environment.yml / | ||
COPY . /pangolin/ | ||
RUN conda env create --quiet -f /environment.yml && conda clean -a | ||
|
||
# Add conda installation dir to PATH (instead of doing 'conda activate') | ||
ENV PATH /opt/conda/envs/pangolin/bin:$PATH | ||
|
||
# Install Pangolin | ||
COPY . /pangolin/ | ||
WORKDIR /pangolin/ | ||
RUN pip install -e . | ||
RUN pangolin --version &> pangolin-version.txt | ||
RUN pip install . && rm -rf /root/.cache/pip | ||
RUN pangolin --version &> /pangolin-version.txt | ||
|
||
# Dump the details of the installed packages to a file for posterity | ||
RUN conda env export --name pangolin > pangolin.yml | ||
RUN conda env export --name pangolin > /pangolin.yml | ||
WORKDIR /tmp/ |