diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..616e056 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,64 @@ +name: docker + +on: + push: + branches: + - main + paths: + - "docker/**" + pull_request: + branches: + - main + paths: + - "docker/**" + +jobs: + generate-matrix: + runs-on: ubuntu-latest + outputs: + matrix-metadata: ${{ steps.metadata.outputs.matrix }} + steps: + - uses: hellofresh/action-changed-files@v3 + id: metadata + with: + pattern: docker/(?P\w+)/.* + default-patterns: | + meta.yml + Dockerfile + environment.txt + + update-docker: + needs: [generate-matrix] + strategy: + matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix-metadata) }} + if: ${{ fromJson(needs.generate-matrix.outputs.matrix-metadata).include[0] }} # skip if the matrix is empty! + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pietrobolcato/action-read-yaml@1.0.0 + id: metadata + with: + config: ${{ github.workspace }}/docker/${{ matrix.image_dir }}/meta.yml + - name: Get date + id: date + run: | + echo "DATE=$(date +"%Y-%m-%d")" >> $GITHUB_OUTPUT + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v4 + # only try building & pushing the container if parsing the metadata worked + if: ${{ steps.metadata.outputs['container'] != '' }} + with: + context: docker/${{ matrix.image_dir }} + # only push container to docker hub if not triggered from a PR + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.metadata.outputs['container'] }} + build-args: | + BUILD_DATE=${{ steps.date.outputs.DATE }} + BUILD_TAG=${{ steps.metadata.outputs['version'] }} + REPONAME=${{ steps.metadata.outputs['image_name'] }} diff --git a/docker/dcc/Dockerfile b/docker/dcc/Dockerfile new file mode 100644 index 0000000..2a7a7ab --- /dev/null +++ b/docker/dcc/Dockerfile @@ -0,0 +1,31 @@ +FROM nciccbr/ccbr_ubuntu_base_20.04:v6 + +# build time variables +ARG BUILD_DATE="000000" +ENV BUILD_DATE=${BUILD_DATE} +ARG BUILD_TAG="000000" +ENV BUILD_TAG=${BUILD_TAG} +ARG REPONAME="000000" +ENV REPONAME=${REPONAME} + +# install conda packages +COPY environment.txt /data2/ +RUN mamba install -c conda-forge -c bioconda --file /data2/environment.txt +ENV R_LIBS_USER=/opt2/conda/lib/R/library/ + +# install DCC +ENV DCC_VERSION=v0.5.0 +RUN wget https://github.com/dieterich-lab/DCC/archive/refs/tags/v0.5.0.tar.gz && \ + tar -xzf DCC-${DCC_VERSION}.tar.gz && \ + cd DCC-${DCC_VERSION} && \ + python setup.py install +RUN which DCC && DCC -h + +# Save Dockerfile in the docker +COPY Dockerfile /opt2/Dockerfile_${REPONAME}.${BUILD_TAG} +RUN chmod a+r /opt2/Dockerfile_${REPONAME}.${BUILD_TAG} + +# cleanup +WORKDIR /data2 +RUN apt-get clean && apt-get purge \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* diff --git a/docker/dcc/environment.txt b/docker/dcc/environment.txt new file mode 100644 index 0000000..bb36a78 --- /dev/null +++ b/docker/dcc/environment.txt @@ -0,0 +1 @@ +python=2.7 \ No newline at end of file diff --git a/docker/dcc/meta.yml b/docker/dcc/meta.yml new file mode 100644 index 0000000..8010ebd --- /dev/null +++ b/docker/dcc/meta.yml @@ -0,0 +1,4 @@ +dockerhub_namespace: nciccbr +image_name: charlie_dcc_py27 +version: v0.1.0 +container: "$(dockerhub_namespace)/$(image_name):$(version)" diff --git a/docker/nclscan_py27/Dockerfile b/docker/nclscan_py27/Dockerfile new file mode 100644 index 0000000..6386538 --- /dev/null +++ b/docker/nclscan_py27/Dockerfile @@ -0,0 +1,23 @@ +FROM nciccbr/ccbr_ubuntu_base_20.04:v6 + +# build time variables +ARG BUILD_DATE="000000" +ENV BUILD_DATE=${BUILD_DATE} +ARG BUILD_TAG="000000" +ENV BUILD_TAG=${BUILD_TAG} +ARG REPONAME="000000" +ENV REPONAME=${REPONAME} + +# install conda packages +COPY environment.txt /data2/ +RUN mamba install -c conda-forge -c bioconda --file /data2/environment.txt +ENV R_LIBS_USER=/opt2/conda/lib/R/library/ + +# Save Dockerfile in the docker +COPY Dockerfile /opt2/Dockerfile_${REPONAME}.${BUILD_TAG} +RUN chmod a+r /opt2/Dockerfile_${REPONAME}.${BUILD_TAG} + +# cleanup +WORKDIR /data2 +RUN apt-get clean && apt-get purge \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* diff --git a/docker/nclscan_py27/environment.txt b/docker/nclscan_py27/environment.txt new file mode 100644 index 0000000..2e647fa --- /dev/null +++ b/docker/nclscan_py27/environment.txt @@ -0,0 +1,7 @@ +python=2.7 +bedtools=2.29.0 +blat=35 +bowtie2=2.5.1 +bwa=0.7.17 +samtools=1.15.1 +novocraft=4.03.05 \ No newline at end of file diff --git a/docker/nclscan_py27/meta.yml b/docker/nclscan_py27/meta.yml new file mode 100644 index 0000000..cb9f816 --- /dev/null +++ b/docker/nclscan_py27/meta.yml @@ -0,0 +1,4 @@ +dockerhub_namespace: nciccbr +image_name: charlie_nclscan_py27 +version: v0.1.0 +container: "$(dockerhub_namespace)/$(image_name):$(version)" diff --git a/docker/star_ucsc_cufflinks/Dockerfile b/docker/star_ucsc_cufflinks/Dockerfile new file mode 100644 index 0000000..6386538 --- /dev/null +++ b/docker/star_ucsc_cufflinks/Dockerfile @@ -0,0 +1,23 @@ +FROM nciccbr/ccbr_ubuntu_base_20.04:v6 + +# build time variables +ARG BUILD_DATE="000000" +ENV BUILD_DATE=${BUILD_DATE} +ARG BUILD_TAG="000000" +ENV BUILD_TAG=${BUILD_TAG} +ARG REPONAME="000000" +ENV REPONAME=${REPONAME} + +# install conda packages +COPY environment.txt /data2/ +RUN mamba install -c conda-forge -c bioconda --file /data2/environment.txt +ENV R_LIBS_USER=/opt2/conda/lib/R/library/ + +# Save Dockerfile in the docker +COPY Dockerfile /opt2/Dockerfile_${REPONAME}.${BUILD_TAG} +RUN chmod a+r /opt2/Dockerfile_${REPONAME}.${BUILD_TAG} + +# cleanup +WORKDIR /data2 +RUN apt-get clean && apt-get purge \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* diff --git a/docker/star_ucsc_cufflinks/environment.txt b/docker/star_ucsc_cufflinks/environment.txt new file mode 100644 index 0000000..7d4e68f --- /dev/null +++ b/docker/star_ucsc_cufflinks/environment.txt @@ -0,0 +1,8 @@ +cufflinks=2.2.1 +gffread +sambamba=0.8.2 +samtools=1.16.1 +star=2.7.6a +ucsc-bedgraphtobigwig +ucsc-bedsort +ucsc-gtftogenepred \ No newline at end of file diff --git a/docker/star_ucsc_cufflinks/meta.yml b/docker/star_ucsc_cufflinks/meta.yml new file mode 100644 index 0000000..3421edb --- /dev/null +++ b/docker/star_ucsc_cufflinks/meta.yml @@ -0,0 +1,4 @@ +dockerhub_namespace: nciccbr +image_name: charlie_star_ucsc_cufflinks +version: v0.1.0 +container: "$(dockerhub_namespace)/$(image_name):$(version)"