Skip to content

Commit

Permalink
Remove unnecessary dependencies in MATLAB image
Browse files Browse the repository at this point in the history
  • Loading branch information
mwthomash authored and ggriffithsuk committed Nov 5, 2024
1 parent f7434a1 commit 6133a14
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
10 changes: 7 additions & 3 deletions matlab/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ ARG MATLAB_DEPS_IMAGE=""
# Specify the URL of the managed version of MathWorks Service Host.
ARG MATHWORKS_SERVICE_HOST_INSTALL_URL=""

# Specify any additional packages to install via apt-ge.
# Specify any additional packages to install via apt-get.
ARG APT_ADDITIONAL_PACKAGES=""
ARG APT_ADDITIONAL_PACKAGES_VNC=""

# Specify MATLAB Install Location.
ARG MATLAB_INSTALL_LOCATION="/opt/matlab/${MATLAB_RELEASE}"
Expand All @@ -33,11 +34,12 @@ ARG MATLAB_INSTALL_LOCATION
ARG MPM_ADDITIONAL_FLAGS
ARG MATHWORKS_SERVICE_HOST_INSTALL_URL
ARG APT_ADDITIONAL_PACKAGES
ARG APT_ADDITIONAL_PACKAGES_VNC

# Install extra tools not included in `matlab-deps`.
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get -qq update \
&& apt-get -qq install --yes \
&& apt-get -qq install --yes --no-install-recommends \
apt-utils \
# Requirements for mpm
ca-certificates \
Expand Down Expand Up @@ -76,9 +78,11 @@ RUN export DEBIAN_FRONTEND=noninteractive \

RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get -qq update \
&& apt-get -qq install --yes \
&& apt-get -qq install --yes --no-install-recommends \
tigervnc-standalone-server \
tigervnc-common \
dbus-x11 \
${APT_ADDITIONAL_PACKAGES_VNC} \
&& apt-get clean \
&& apt-get -y autoremove \
&& rm -rf /var/lib/apt/lists/*
Expand Down
7 changes: 7 additions & 0 deletions matlab/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ variable "APT_ADDITIONAL_PACKAGES" {
default = ""
}

# This package is not available for Ubuntu 20.04 but is needed for later versions.
# Once we don't support 20.04 this can be added to the Dockerfile rather than being set here
variable "APT_ADDITIONAL_PACKAGES_VNC" {
default = "tigervnc-tools"
}

variable "MATHWORKS_SERVICE_HOST_INSTALL_URL" {
default = "https://www.mathworks.com/MathWorksServiceHost/glnxa64/install_managed_msh.sh"
}
Expand All @@ -32,6 +38,7 @@ variable "common_args" {
MATLAB_RELEASE = "${MATLAB_RELEASE}"
MPM_ADDITIONAL_FLAGS = "${MPM_ADDITIONAL_FLAGS}"
APT_ADDITIONAL_PACKAGES = "${APT_ADDITIONAL_PACKAGES}"
APT_ADDITIONAL_PACKAGES_VNC = "${APT_ADDITIONAL_PACKAGES_VNC}"
MATHWORKS_SERVICE_HOST_INSTALL_URL = "${MATHWORKS_SERVICE_HOST_INSTALL_URL}"
}
}
Expand Down
3 changes: 3 additions & 0 deletions matlab/release-config/R2023a.env.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ MATLAB_RELEASE="R2023a"

# Ubuntu 20.04 requires python3.8-venv when using pipx
APT_ADDITIONAL_PACKAGES="python3.8-venv"

# Ubuntu 20.04 has vncpasswd provided by tigervnc-common so don't need tigervnc-tools
APT_ADDITIONAL_PACKAGES_VNC=""

0 comments on commit 6133a14

Please sign in to comment.