Skip to content

Commit

Permalink
try to cut down size of Docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
peterk87 committed Dec 22, 2020
1 parent b744d52 commit fcbcdbd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.git
.dockerignore
21 changes: 13 additions & 8 deletions Dockerfile
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/

0 comments on commit fcbcdbd

Please sign in to comment.