-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
68 lines (57 loc) · 2.25 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#
# Docker file to create a Compute Server Node Manager
#
FROM ubuntu:20.04 as buildmanager
ARG GRB_VERSION=11.0.1
ARG GRB_SHORT_VERSION=11.0
ARG TARGETPLATFORM
# Create a script to determine GRB_PLATFORM based on TARGETPLATFORM
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
echo "armlinux64" > /platform.txt; \
else \
echo "linux64" > /platform.txt; \
fi
# install manager package and copy the files
WORKDIR /opt
RUN export GRB_PLATFORM=$(cat /platform.txt) && echo $GRB_PLATFORM \
&&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_server${GRB_VERSION}_$GRB_PLATFORM.tar.gz \
&& tar -xvf gurobi_server${GRB_VERSION}_$GRB_PLATFORM.tar.gz \
&& rm -f gurobi_server${GRB_VERSION}_$GRB_PLATFORM.tar.gz \
&& mv -f gurobi_server* gurobi_server \
&& rm -rf gurobi_server/$GRB_PLATFORM/docs \
&& mv -f gurobi_server/$GRB_PLATFORM* gurobi_server/linux
# After the file renaming, a clean image is built
FROM ubuntu:20.04 AS packagemanager
ARG GRB_VERSION=11.0.1
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_server
COPY --from=buildmanager /opt/gurobi_server/linux/bin/grb_rsm ./linux/bin/grb_rsm
COPY --from=buildmanager /opt/gurobi_server/linux/bin/grbcluster ./linux/bin/grbcluster
COPY --from=buildmanager /opt/gurobi_server/linux/bin/grb_rsm.cnf ./linux/bin/grb_rsm.cnf
COPY --from=buildmanager /opt/gurobi_server/linux/resources/grb_rsm ./linux/resources/grb_rsm
COPY --from=buildmanager /opt/gurobi_server/linux/EULA.pdf ./linux/EULA.pdf
ENV GRB_HOME=/opt/gurobi_server/linux
ENV PATH $GRB_HOME/bin:$PATH
WORKDIR $GRB_HOME/bin
# changes group permissions to run as a non-root user for better security
RUN chgrp -R 0 /opt/gurobi_server/linux/bin && \
chmod -R g=u /opt/gurobi_server/linux/bin
# User to run the container
USER 1001
# expose command line
ENTRYPOINT ["grb_rsm", "--port=61080","--console-ts"]
EXPOSE 61080