-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
52 lines (40 loc) · 1.24 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
46
47
48
49
50
51
52
#
# Docker file to create a Python Environment
#
FROM ubuntu:20.04 as buildoptimizer
ARG GRB_VERSION=9.1.2
ARG GRB_SHORT_VERSION=9.1
# install gurobi package and copy the files
WORKDIR /opt
RUN apt-get update \
&& apt-get install --no-install-recommends -y\
ca-certificates \
wget \
&& update-ca-certificates \
&& wget -v https://packages.gurobi.com/${GRB_SHORT_VERSION}/gurobi${GRB_VERSION}_linux64.tar.gz \
&& tar -xvf gurobi${GRB_VERSION}_linux64.tar.gz \
&& rm -f gurobi${GRB_VERSION}_linux64.tar.gz \
&& mv -f gurobi* gurobi \
&& rm -rf gurobi/linux64/docs
# After the file renaming, a clean image is build
FROM python:3.7-slim AS packageoptimizer
ARG GRB_VERSION=9.1.2
LABEL vendor="Gurobi"
LABEL version=${GRB_VERSION}
# update system and certificates
RUN apt-get update \
&& apt-get install --no-install-recommends -y\
ca-certificates \
p7zip-full \
zip \
&& update-ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /opt/gurobi
COPY --from=buildoptimizer /opt/gurobi .
ENV GUROBI_HOME /opt/gurobi/linux64
ENV PATH $PATH:$GUROBI_HOME/bin
ENV LD_LIBRARY_PATH $GUROBI_HOME/lib
WORKDIR /opt/gurobi/linux64
#run the setup
RUN python setup.py install
CMD ["gurobi.sh"]