diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..7012c325 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +# Don't include the .git in the image. It's big! +.git diff --git a/Dockerfile b/Dockerfile index 5335330f..ed2b65e4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,21 @@ FROM ghcr.io/jorgensd/dolfinx-tutorial:v0.6.0 # create user with a home directory -ARG NB_USER +ARG NB_USER=jovyan ARG NB_UID=1000 -ENV USER ${NB_USER} +RUN useradd -m ${NB_USER} -u ${NB_UID} ENV HOME /home/${NB_USER} +# for binder: base image upgrades lab to require jupyter-server 2, +# but binder explicitly launches jupyter-notebook +# force binder to launch jupyter-server instead +RUN nb=$(which jupyter-notebook) \ + && rm $nb \ + && ln -s $(which jupyter-lab) $nb + # Copy home directory for usage in binder WORKDIR ${HOME} -COPY . ${HOME} -USER root -RUN chown -R ${NB_UID} ${HOME} +COPY --chown=${NB_UID} . ${HOME} USER ${NB_USER} -ENTRYPOINT [] \ No newline at end of file +ENTRYPOINT []