Skip to content

Commit

Permalink
Merge pull request #171 from nmfs-opensci/eeholmes-patch-2
Browse files Browse the repository at this point in the history
Update Dockerfile
  • Loading branch information
eeholmes authored Nov 14, 2024
2 parents 7ddecd6 + 34e922a commit 913913c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,17 @@ RUN mkdir -p /pyrocket_scripts && \
RUN usermod -a -G staff "${NB_USER}"

# Install R, RStudio via Rocker scripts
ENV R_DOCKERFILE="verse_${R_VERSION}"
RUN PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin && \
chmod +x ${REPO_DIR}/rocker.sh && \
${REPO_DIR}/rocker.sh
# ENV R_DOCKERFILE="verse_${R_VERSION}"
# 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 conda packages
RUN /pyrocket_scripts/install-conda-packages.sh ${REPO_DIR}/environment.yml

# Install extra apt packages
# Install linux packages after R installation since the R install scripts get rid of packages
RUN /pyrocket_scripts/install-apt-packages.sh ${REPO_DIR}/apt.txt
# RUN /pyrocket_scripts/install-apt-packages.sh ${REPO_DIR}/apt.txt

# Re-enable man pages disabled in Ubuntu 18 minimal image
# https://wiki.ubuntu.com/Minimal
Expand Down
5 changes: 3 additions & 2 deletions scripts/install-conda-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if ! ${CONDA_DIR}/condabin/conda env list | grep -q "^${CONDA_ENV} "; then
INSTALLATION_HAPPENED=true
elif grep -q "name:" "$ENV_FILE"; then
echo " Detected environment.yml file."
${CONDA_DIR}/condabin/mamba env create -f "$ENV_FILE"
${CONDA_DIR}/condabin/mamba env create --name ${CONDA_ENV} -f "$ENV_FILE"
INSTALLATION_HAPPENED=true
else
echo "Error: Unrecognized file format in '${ENV_FILE}'."
Expand All @@ -61,7 +61,7 @@ else
${CONDA_DIR}/condabin/mamba env update --name ${CONDA_ENV} -f "$ENV_FILE"
INSTALLATION_HAPPENED=true
else
echo "Error: Unrecognized file format in '${ENV_FILE}'."
echo " Error: Unrecognized file format in '${ENV_FILE}'."
echo " - For an environment.yml file, ensure it includes a 'name:' entry. Any name is acceptable."
echo " - For a conda-lock.yml file, ensure it includes a 'lock_set:' entry."
exit 1
Expand All @@ -70,6 +70,7 @@ fi

# Run cleanup if installation occurred
if [ "$INSTALLATION_HAPPENED" = true ]; then
echo "Installation clean-up."
${CONDA_DIR}/condabin/mamba clean -yaf
find ${CONDA_DIR} -follow -type f -name '*.a' -delete
find ${CONDA_DIR} -follow -type f -name '*.js.map' -delete
Expand Down

0 comments on commit 913913c

Please sign in to comment.