Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker build updates #3

Merged
merged 7 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@ LABEL maintainer "Daniel Park <[email protected]>"
# non-interactive session just for build
ARG DEBIAN_FRONTEND=noninteractive

# update apt database and install R apt repo
# update apt database and install R apt repo; install all desired packages
RUN apt-get update && \
apt-get -y -qq install software-properties-common && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 && \
add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/' && \
apt-get update

# install all desired packages
RUN apt-get -y -qq install \
less nano vim git wget curl jq zstd parallel locales \
apt-get update && \
apt-get -y -qq install \
less nano vim git wget curl jq zstd pigz parallel locales \
gnupg libssl-dev libcurl4-openssl-dev \
libgsl-dev libxml2 libxml2-dev \
imagemagick libmagick++-dev \
Expand All @@ -35,9 +33,9 @@ RUN R -e "for (lib in c( 'LaplacesDemon', 'kmer', 'phylogram', 'aphid', 'insect'
# Rfast in CRAN is broken, install from github
RUN R -e "devtools::install_github('RfastOfficial/Rfast', dependencies=TRUE); library(Rfast)"

# Install reconstructR R package -- invalidate cache any time github main branch updates
ADD https://api.github.com/repos/broadinstitute/reconstructR/git/refs/heads/main version.json
RUN R -e "devtools::install_github('broadinstitute/reconstructR', dependencies=TRUE, upgrade='never'); library(reconstructR)"
# Install reconstructR R package
COPY . /opt/reconstructR
RUN R -e "devtools::install_local('/opt/reconstructR', dependencies=TRUE, upgrade='never'); library(reconstructR)"

# Bash prompt
CMD ["/bin/bash"]
12 changes: 12 additions & 0 deletions scripts/cp_and_decompress.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

INFILE=$1
OUTFILE=$2

if [[ $INFILE == *.gz ]]; then
pigz -dc $INFILE > $OUTFILE
elif [[ $INFILE == *.zst ]]; then
zstd -d $INFILE -o $OUTFILE
else
cp $INFILE $OUTFILE
fi
17 changes: 17 additions & 0 deletions scripts/mcp_and_decompress.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

INFILES=${@:1:$#-1}
OUTDIR=${@:$#}

for INFILE in $INFILES; do
if [[ $INFILE == *.gz ]]; then
OUTFNAME=$(basename $INFILE .gz)
pigz -dc $INFILE > "$OUTDIR/$OUTFNAME"
elif [[ $INFILE == *.zst ]]; then
OUTFNAME=$(basename $INFILE .zst)
zstd -d $INFILE -o "$OUTDIR/$OUTFNAME"
else
OUTFNAME=$(basename $INFILE)
cp $INFILE "$OUTDIR/$OUTFNAME"
fi
done
Loading