Skip to content

Commit 0bc95b6

Browse files
committed
Set workdir to /home/jovyan and install MATLAB Engine for Python
1 parent e5ef252 commit 0bc95b6

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

matlab/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,18 @@ RUN export DEBIAN_FRONTEND=noninteractive &&\
8484
rm -fr /packages
8585
WORKDIR /
8686

87+
# Installing MATLAB Engine for Python
88+
RUN export DEBIAN_FRONTEND=noninteractive && apt-get update \
89+
&& apt-get install --no-install-recommends -y python3-distutils \
90+
&& apt-get clean \
91+
&& apt-get -y autoremove \
92+
&& rm -rf /var/lib/apt/lists/* \
93+
&& cd /opt/matlab/extern/engines/python \
94+
&& python setup.py install
95+
8796
# Switch back to notebook user
8897
USER $NB_USER
98+
WORKDIR /home/${NB_USER}
8999

90100
# Install integration
91101
RUN python -m pip install jupyter-matlab-proxy

matlab/Dockerfile.byoi

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,11 @@ USER root
6868
ENV DEBIAN_FRONTEND="noninteractive" TZ="Etc/UTC"
6969

7070
# Copy MATLAB install from supplied Docker image
71-
COPY --from=matlab-install-stage ${BASE_ML_INSTALL_LOC} /usr/local/MATLAB
71+
ARG MATLAB_INSTALL_LOCATION="/opt/matlab"
72+
COPY --from=matlab-install-stage ${BASE_ML_INSTALL_LOC} ${MATLAB_INSTALL_LOCATION}
7273

7374
# Put MATLAB on the PATH
74-
RUN ln -s /usr/local/MATLAB/bin/matlab /usr/local/bin/matlab
75+
RUN ln -s ${MATLAB_INSTALL_LOCATION}/bin/matlab /usr/local/bin/matlab
7576

7677
## Installing Dependencies for Ubuntu 20.04
7778
# For MATLAB : Get base-dependencies.txt from matlab-deps repository on GitHub
@@ -102,8 +103,18 @@ RUN export DEBIAN_FRONTEND=noninteractive &&\
102103
rm -fr /packages
103104
WORKDIR /
104105

106+
# Installing MATLAB Engine for Python
107+
RUN export DEBIAN_FRONTEND=noninteractive && apt-get update \
108+
&& apt-get install --no-install-recommends -y python3-distutils \
109+
&& apt-get clean \
110+
&& apt-get -y autoremove \
111+
&& rm -rf /var/lib/apt/lists/* \
112+
&& cd ${MATLAB_INSTALL_LOCATION}/extern/engines/python \
113+
&& python setup.py install
114+
105115
# Switch back to notebook user
106116
USER $NB_USER
117+
WORKDIR /home/${NB_USER}
107118

108119
# Install integration
109120
RUN python -m pip install jupyter-matlab-proxy

matlab/Dockerfile.mounted

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ WORKDIR /
7171

7272
# Switch back to notebook user
7373
USER $NB_USER
74+
WORKDIR /home/${NB_USER}
7475

7576
# Install integration
7677
RUN python -m pip install jupyter-matlab-proxy

0 commit comments

Comments
 (0)