forked from aretasg/pacpac
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (25 loc) · 788 Bytes
/
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
FROM frolvlad/alpine-miniconda3 as build
WORKDIR pacpac
COPY environment.yml setup.py ./
WORKDIR pacpac
COPY pacpac .
WORKDIR ..
RUN conda env create -f environment.yml
RUN echo "source activate pacpac" > ~/.bashrc
ENV PATH /opt/conda/envs/pacpac/bin:$PATH
RUN pip install .
########## conda-pack bit to reduce image size
RUN conda install conda-pack
# Use conda-pack to create a standalone enviornment in /venv
RUN conda-pack -n pacpac -o /tmp/env.tar && \
mkdir /venv && cd /venv && tar xf /tmp/env.tar && \
rm /tmp/env.tar
# Fix up paths:
RUN /venv/bin/conda-unpack
##########
FROM debian:buster AS runtime
# Copy /venv from the previous stage
COPY --from=build /venv /venv
RUN echo "source /venv/bin/activate" > ~/.bashrc
ENV PATH /venv/bin:$PATH
ENTRYPOINT ["pacpac"]