Skip to content

Commit

Permalink
Merge pull request #118 from nmfs-opensci/dev
Browse files Browse the repository at this point in the history
remove apt-extras and postBuild
  • Loading branch information
eeholmes authored Oct 29, 2024
2 parents eb86dc2 + 695381e commit 5a7db8b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
20 changes: 13 additions & 7 deletions appendix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
USER root

# repo2docker does not set this; name is vague. This is the default env in repo2docker type images
# repo2docker does not set this. This is the default env in repo2docker type images
ENV CONDA_ENV=notebook

# Install R, RStudio via Rocker scripts
Expand All @@ -13,11 +13,9 @@ RUN PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin && \
chmod +x ${REPO_DIR}/rocker.sh && \
${REPO_DIR}/rocker.sh

# Install extra cmd line packages after R installation
# The package_list part is reading the file and doing clean-up to just have the list of packages
RUN package_list=$(grep -v '^\s*#' ${REPO_DIR}/apt-extras.txt | grep -v '^\s*$' | sed 's/\r//g; s/#.*//; s/^[[:space:]]*//; s/[[:space:]]*$//' | awk '{$1=$1};1') && \
apt-get update && \
apt-get install --yes --no-install-recommends $package_list && \
# Install any missing build packages. Most are installed when R installed but get any missing packages
RUN apt-get update && \
apt-get install --yes --no-install-recommends build-essential gfortran && \
apt-get autoremove --purge && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
Expand All @@ -32,14 +30,19 @@ RUN yes | unminimize
ENV MANPATH="${NB_PYTHON_PREFIX}/share/man:${MANPATH}"
RUN mandb

# Add custom jupyter config. You can also put config.py files in the same place
RUN cp ${REPO_DIR}/custom_jupyter_server_config.json ${NB_PYTHON_PREFIX}/etc/jupyter/jupyter_server_config.d/
RUN cp ${REPO_DIR}/custom_jupyter_server_config.json ${NB_PYTHON_PREFIX}/etc/jupyter/jupyter_notebook_config.d/

# Clean up extra files in ${REPO_DIR}
RUN rm -rf ${REPO_DIR}/book ${REPO_DIR}/docs

###################
# Set up behavior for child dockerfiles
# Convert NB_USER to ENV (from ARG) so that it passes to the child dockerfile
ENV NB_USER=${NB_USER}

## ONBUILD section. These are run in child Dockerfiles. These are run right after the FROM image is loaded
## ONBUILD section. These commands are run in child Dockerfiles. These are run right after the FROM image is loaded

ONBUILD USER ${NB_USER}

Expand Down Expand Up @@ -154,6 +157,9 @@ ONBUILD RUN echo "Checking for 'postBuild'..." \
&& find ${CONDA_DIR} -follow -type f -name '*.js.map' -delete \
; fi

## End ONBUILD section for child images
################################

# Revert to default user and home as pwd
USER ${NB_USER}
WORKDIR ${HOME}
3 changes: 1 addition & 2 deletions apt-extras.txt → apt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ mc

# Regular build tools for compiling common stuff
# most installed with R installation
build-essential
gfortran
# need to install after R so these added to appendix

# Dependencies for nbconvert and myst
# texlive is installed by R installation
Expand Down

0 comments on commit 5a7db8b

Please sign in to comment.