Skip to content

Commit

Permalink
feat: docker files build
Browse files Browse the repository at this point in the history
  • Loading branch information
dnousome committed Mar 7, 2024
1 parent 32ca752 commit a813f22
Show file tree
Hide file tree
Showing 6 changed files with 169 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -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<image_dir>\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'] }}
34 changes: 34 additions & 0 deletions docker/annotate_cnvsv/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 <nousomedr@nih.gov>

# 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}

4 changes: 4 additions & 0 deletions docker/annotate_cnvsv/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dockerhub_namespace: dnousome
image_name: ccbr_annotate_cnvsv
version: v0.0.1
container: "$(dockerhub_namespace)/$(image_name):$(version)"
59 changes: 59 additions & 0 deletions docker/lofreq/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 <nousomedr@nih.gov>

# 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
11 changes: 11 additions & 0 deletions docker/lofreq/build.sh
Original file line number Diff line number Diff line change
@@ -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



4 changes: 4 additions & 0 deletions docker/logan_base/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dockerhub_namespace: dnousome
image_name: ccbr_logan_base
version: v0.3.4
container: "$(dockerhub_namespace)/$(image_name):$(version)"

0 comments on commit a813f22

Please sign in to comment.