-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.Dockerfile
38 lines (31 loc) · 1.19 KB
/
build.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
38
# Set the base image to Ubuntu
FROM continuumio/miniconda3:23.9.0-0
# 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 --chown=allagash:allagash ci-environment.yml ci-environment.yml
# Copy the license and readme file into the source so it will be included in the built package
COPY --chown=allagash:allagash src LICENSE README.md pyproject.toml ./
# Configure conda env
RUN conda env create -f ci-environment.yml
RUN /opt/conda/envs/allagash/bin/python -m pip install build \
&& /opt/conda/envs/allagash/bin/python -m build \
&& /opt/conda/envs/allagash/bin/python -m pip install allagash --no-deps --no-index --find-links dist \
&& conda clean -a -f -y
ENV PATH /opt/conda/envs/allagash/bin:$PATH