-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
executable file
·45 lines (37 loc) · 1.16 KB
/
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
39
40
41
42
43
44
45
# Multi-stage SMRF docker build
FROM python:3.6-slim-buster as builder
RUN mkdir /install \
&& mkdir /build \
&& apt-get update -y \
&& apt-get install -y --no-install-recommends \
gcc \
git \
libssl-dev \
libyaml-dev \
libhdf5-serial-dev \
curl \
libeccodes-tools \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get autoremove -y curl
COPY . /build
WORKDIR /build
RUN python3 -m pip install --no-cache-dir --upgrade pip \
&& python3 -m pip install --no-cache-dir setuptools wheel \
&& python3 -m pip install --no-cache-dir --user .[tests] \
&& python3 setup.py bdist_wheel \
&& python3 setup.py build_ext --inplace
##############################################
# main image
##############################################
FROM python:3.6-slim-buster
COPY --from=builder /root/.local /usr/local
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends libeccodes-tools \
&& python3 -m pip install --no-cache-dir nose \
&& nosetests -vv --exe smrf \
&& python3 -m pip uninstall -y nose \
&& rm -rf /var/lib/apt/lists/*
# Create a shared data volume
VOLUME /data
WORKDIR /data
CMD ["/bin/bash"]