Skip to content

Commit

Permalink
Merge pull request #24 from nmfs-opensci/eeholmes-dev-1
Browse files Browse the repository at this point in the history
minimal rocker.sh
  • Loading branch information
eeholmes authored Oct 8, 2024
2 parents 20c1df2 + 7513cc8 commit 38f9a92
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
3 changes: 1 addition & 2 deletions appendix
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ RUN mandb

RUN chmod +x ${REPO_DIR}/rocker.sh && ${REPO_DIR}/rocker.sh

# Revert to default user
USER ${NB_USER}
# stay as root
15 changes: 0 additions & 15 deletions rocker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,3 @@ mv rocker-versioned2-R${R_VERSION}/scripts rocker_scripts && \
mv rocker-versioned2-R${R_VERSION}/dockerfiles/verse_${R_VERSION}.Dockerfile rocker_scripts/verse_${R_VERSION}.Dockerfile && \
rm R${R_VERSION}.tar.gz && \
rm -rf rocker-versioned2-R${R_VERSION}

# Read the Dockerfile and process each line
while IFS= read -r line; do
# Check if the line starts with ENV or RUN
if [[ "$line" == ENV* ]]; then
# Export the environment variable from the ENV line
eval $(echo "$line" | sed 's/^ENV //g')
elif [[ "$line" == RUN* ]]; then
# Run the command from the RUN line
cmd=$(echo "$line" | sed 's/^RUN //g')
full_cmd="${REPO_DIR}${cmd}"
echo "Executing: $full_cmd"
eval "$full_cmd"
fi
done < rocker_scripts/verse_${R_VERSION}.Dockerfile

0 comments on commit 38f9a92

Please sign in to comment.