lucananni93 há 2 anos atrás
pai
commit
a875684595
3 ficheiros alterados com 48 adições e 0 exclusões
  1. 1 0
      DESCRIPTION
  2. 32 0
      docker/Dockerfile
  3. 15 0
      docker/docker_build.sh

+ 1 - 0
DESCRIPTION

@@ -18,6 +18,7 @@ License: MIT
 Encoding: UTF-8
 Depends:
     R (>= 3.5.2)
+biocViews:
 Imports: 
 	R.utils (>= 2.9.0),
 	doParallel (>= 1.0.15),

+ 32 - 0
docker/Dockerfile

@@ -0,0 +1,32 @@
+# We need Bioconductor, so we inherit from their repositorycd .
+FROM bioconductor/bioconductor_docker
+
+ARG tag_name
+ARG repo_name
+
+ENV github_tag=$tag_name
+ENV github_repo=$repo_name
+
+RUN echo "Building repo ${github_repo} with tag: ${github_tag}"
+
+################
+# CALDER SETUP #
+################
+
+# Get latest release tag
+RUN wget https://github.com/${github_repo}/archive/refs/tags/${github_tag}.tar.gz
+# Untar the release
+RUN tar xvfs ${github_tag}.tar.gz
+# Adding calder script to bin
+ENV calder_cmd=CALDER2-${github_tag}/scripts/calder
+RUN ln -s $(realpath ${calder_cmd}) /bin/
+# Removing tar file
+RUN rm ${github_tag}.tar.gz
+
+# # Install latest release of the package
+RUN R -e "remotes::install_github('CSOgroup/CALDER2@*release'); if (!library(CALDER, logical.return=T)) quit(status=10)"
+
+# # Install other packages
+RUN pip install cooler 
+
+CMD ["R"]

+ 15 - 0
docker/docker_build.sh

@@ -0,0 +1,15 @@
+#!/bin/bash
+
+DOCKERHUB_USERNAME="lucananni93"
+PACKAGE_NAME="calder2"
+GITHUB_REPO="CSOgroup/CALDER2"
+DOCKER_FILE="docker/Dockerfile"
+LATEST_TAG=$(curl --silent "https://api.github.com/repos/${GITHUB_REPO}/releases/latest" | grep '"tag_name"' | cut -d':' -f2 | tr -d '," ')
+
+echo "Building Docker for ${GITHUB_REPO} at ${DOCKERHUB_USERNAME}/${PACKAGE_NAME}:${LATEST_TAG}"
+
+docker build . \
+			-t ${DOCKERHUB_USERNAME}/${PACKAGE_NAME}:${LATEST_TAG} \
+			-f ${DOCKER_FILE} \
+			--build-arg tag_name=${LATEST_TAG} \
+			--build-arg repo_name=${GITHUB_REPO}