diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml new file mode 100644 index 0000000..49ebb9a --- /dev/null +++ b/.github/workflows/docker.yaml @@ -0,0 +1,57 @@ +name: Build and push Docker images + +on: + push: + branches: + - 'main' + - '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 + + 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'] }} \ No newline at end of file diff --git a/docker/annotate_cnvsv/Dockerfile b/docker/annotate_cnvsv/Dockerfile new file mode 100644 index 0000000..c38e1e8 --- /dev/null +++ b/docker/annotate_cnvsv/Dockerfile @@ -0,0 +1,34 @@ +FROM --platform=linux/amd64 nciccbr/ccbr_ubuntu_base_20.04:v5 + +# 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} + +LABEL maintainer + +# Create Container filesystem specific +# working directory and opt directories +WORKDIR /opt2 + +###Create AnnotSV +RUN wget https://github.com/lgmgeo/AnnotSV/archive/refs/tags/v3.3.6.tar.gz \ + && tar -xvjf /opt2/3.3.6.tar.gz \ + && rm /opt2/3.3.6.tar.gz +ENV PATH="/opt2/AnnotSV-3.3.6/bin:$PATH" + +##ClassifyCNV +##Update the resources for ClassifyCNV +RUN wget https://github.com/Genotek/ClassifyCNV/archive/refs/tags/v1.1.1.tar.gz \ + && tar -xvjf /opt2/v1.1.1.tar.gz \ + && rm /opt2/v1.1.1.tar.gz +ENV PATH="/opt2/ClassifyCNV-1.1.1:$PATH" +RUN update_clingen.sh + + +COPY Dockerfile /opt2/Dockerfile_${REPONAME}.${BUILD_TAG} +RUN chmod a+r /opt2/Dockerfile_${REPONAME}.${BUILD_TAG} + diff --git a/docker/annotate_cnvsv/meta.yml b/docker/annotate_cnvsv/meta.yml new file mode 100644 index 0000000..5c62fda --- /dev/null +++ b/docker/annotate_cnvsv/meta.yml @@ -0,0 +1,4 @@ +dockerhub_namespace: dnousome +image_name: ccbr_annotate_cnvsv +version: v0.0.1 +container: "$(dockerhub_namespace)/$(image_name):$(version)" diff --git a/docker/lofreq/Dockerfile b/docker/lofreq/Dockerfile new file mode 100644 index 0000000..01ef8de --- /dev/null +++ b/docker/lofreq/Dockerfile @@ -0,0 +1,59 @@ +FROM --platform=linux/amd64 ubuntu:22.04 + +# 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} + +LABEL maintainer + +# Create Container filesystem specific +# working directory and opt directories + +# This section installs system packages required for your project +# If you need extra system packages add them here. +RUN apt-get update \ + && apt-get -y upgrade \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y \ + automake \ + build-essential \ + curl \ + git \ + gcc \ + libbz2-dev \ + libcurl4-gnutls-dev \ + libgsl0-dev \ + libperl-dev \ + liblzma-dev \ + libncurses5-dev \ + libssl-dev \ + python3-dev \ + zlib1g-dev + +RUN ln -s /usr/bin/python3.10 /usr/bin/python + +WORKDIR /opt2 + +ARG htsversion=1.19 + +RUN curl -L https://github.com/samtools/htslib/releases/download/${htsversion}/htslib-${htsversion}.tar.bz2 | tar xj \ + && cd htslib-${htsversion} \ + && ./configure \ + && make \ + && make install + +RUN curl -L https://github.com/samtools/bcftools/releases/download/${htsversion}/bcftools-${htsversion}.tar.bz2 | tar xj \ + && cd bcftools-${htsversion} \ + && ./configure && make && make install + +RUN git clone https://github.com/CSB5/lofreq \ + && cd lofreq \ + && ./bootstrap \ + && ./configure --with-htslib=/usr/local \ + && make \ + && make install + +ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH diff --git a/docker/lofreq/build.sh b/docker/lofreq/build.sh new file mode 100644 index 0000000..4f87a24 --- /dev/null +++ b/docker/lofreq/build.sh @@ -0,0 +1,11 @@ +# Build image + +docker build --platform linux/amd64 --tag ccbr_logan_base:v0.3.4 -f Dockerfile . + +docker tag ccbr_lofreq:v0.0.1 dnousome/ccbr_lofreq:v0.0.1 +docker push dnousome/ccbr_lofreq:v0.0.1 + +docker push dnousome/ccbr_logan_base:latest + + + diff --git a/docker/logan_base/meta.yml b/docker/logan_base/meta.yml new file mode 100644 index 0000000..b7893e7 --- /dev/null +++ b/docker/logan_base/meta.yml @@ -0,0 +1,4 @@ +dockerhub_namespace: dnousome +image_name: ccbr_logan_base +version: v0.3.4 +container: "$(dockerhub_namespace)/$(image_name):$(version)"