-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDockerfile
37 lines (30 loc) · 1004 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
37
# Set the base image to Ubuntu
FROM continuumio/miniconda3:23.9.0-0
ARG VERSION
# File Author / Maintainer
MAINTAINER Aaron Pulver <[email protected]>
# Switch to root for install
USER root
ENV HOME /home/allagash
# Install COINOR CBC and GLPK
# Create the user
RUN apt-get update -y && apt-get install -y \
--no-install-recommends \
coinor-cbc \
glpk-utils \
&& rm -rf /var/lib/apt/lists/* \
&& useradd --create-home --home-dir $HOME allagash \
&& chmod -R u+rwx $HOME \
&& chown -R allagash:allagash $HOME \
&& chown -R allagash:allagash /opt/conda
# switch back to user
USER allagash
WORKDIR $HOME
# Copy in environment file
COPY --chown=allagash:allagash ci-environment.yml ci-environment.yml
# Configure conda env
RUN conda env create -f ci-environment.yml \
&& /opt/conda/envs/allagash/bin/pip install allagash==${VERSION} --no-deps \
&& conda clean -a -f -y
COPY --chown=allagash:allagash src-doc/examples examples
ENV PATH /opt/conda/envs/allagash/bin:$PATH