-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.ubuntu22.04
99 lines (88 loc) · 3 KB
/
Dockerfile.ubuntu22.04
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Copyright 2022-2024 The MathWorks, Inc.
# To specify which MATLAB release to install in the container, edit the value of the MATLAB_RELEASE argument.
# Use lower case to specify the release, for example: ARG MATLAB_RELEASE=r2022b
ARG MATLAB_RELEASE=R2024b
# Build on top of Ubuntu22.04
FROM ubuntu:22.04
# Declare the global argument to use at the current build stage
ARG MATLAB_RELEASE
# Install Polyspace Bug Finder and Code Prover dependencies
ENV DEBIAN_FRONTEND="noninteractive" TZ="Etc/UTC"
RUN apt-get update && apt-get install --no-install-recommends -y \
ca-certificates \
libasound2 \
libc6 \
libcairo-gobject2 \
libcairo2 \
libcrypt1 \
libcups2 \
libdrm2 \
libgbm1 \
libgdk-pixbuf-2.0-0 \
libgl1 \
libglib2.0-0 \
libgstreamer-plugins-base1.0-0 \
libgstreamer1.0-0 \
libgtk-3-0 \
libice6 \
libnspr4 \
libnss3 \
libpam0g \
libpango-1.0-0 \
libpangocairo-1.0-0 \
libpangoft2-1.0-0 \
libsndfile1 \
libuuid1 \
libwayland-client0 \
libxcomposite1 \
libxcursor1 \
libxdamage1 \
libxfixes3 \
libxft2 \
libxinerama1 \
libxrandr2 \
libxt6 \
libxtst6 \
libxxf86vm1 \
locales \
locales-all \
zlib1g
# Install mpm dependencies
RUN apt-get install --no-install-recommends --yes \
wget \
unzip \
sudo \
ca-certificates && \
apt-get clean && apt-get autoremove
# Run mpm to install Polyspace Bug Finder and Code Prover Server in the target location
# and delete the mpm installation afterwards
RUN wget -q https://www.mathworks.com/mpm/glnxa64/mpm && \
chmod +x mpm && \
./mpm install \
--release=${MATLAB_RELEASE} \
--destination=/opt/matlab \
--products Polyspace_Bug_Finder_Server Polyspace_Code_Prover_Server && \
rm -f mpm /tmp/mathworks_root.log && \
ln -s /opt/matlab/polyspace/bin/polyspace* /usr/local/bin/
# Add a "polyspace" user and grant sudo permission.
RUN adduser --shell /bin/bash --disabled-password --gecos "" polyspace && \
echo "polyspace ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/polyspace && \
chmod 0440 /etc/sudoers.d/polyspace
# One of the following 2 ways of configuring the license server to use must be
# uncommented.
ARG LICENSE_SERVER
# Specify the host and port of the machine that serves the network licenses
# if you want to bind in the license info as an environment variable. This
# is the preferred option for licensing. It is either possible to build with
# something like --build-arg LICENSE_SERVER=27000@MyServerName, alternatively
# you could specify the license server directly using
# ENV MLM_LICENSE_FILE=27000@flexlm-server-name
ENV MLM_LICENSE_FILE=$LICENSE_SERVER
# Alternatively you can put a license file into the container.
# You should fill this file out with the details of the license
# server you want to use and uncomment the following line.
# COPY network.lic /opt/matlab/licenses/
# Set user and work directory
USER polyspace
WORKDIR /home/polyspace
CMD []