-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
65 lines (54 loc) · 2.06 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
#
# Docker file to create a Compute Server Node Manager
#
FROM ubuntu:20.04 as buildmanager
ARG GRB_VERSION=12.0.0
ARG GRB_SHORT_VERSION=12.0
ARG TARGETPLATFORM
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
ca-certificates \
wget \
&& update-ca-certificates
# install manager package and copy the files
WORKDIR /opt
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
export GRB_PLATFORM="armlinux64"; \
else \
export GRB_PLATFORM="linux64"; \
fi \
&& 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 *.tar.gz \
&& mv -f gurobi_server* gurobi_server \
&& 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=12.0.0
LABEL vendor="Gurobi"
LABEL version=${GRB_VERSION}
# update system and certificates
RUN apt-get update -o Debug::Acquire::http=true \
&& 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