Skip to content

Commit d187eaf

Browse files
authored
Merge pull request #36 from CCBR/dockers
feat: docker files build
2 parents 32ca752 + a813f22 commit d187eaf

File tree

6 files changed

+169
-0
lines changed

6 files changed

+169
-0
lines changed

.github/workflows/docker.yaml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build and push Docker images
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
- 'docker'
8+
9+
jobs:
10+
generate-matrix:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
matrix-metadata: ${{ steps.metadata.outputs.matrix }}
14+
steps:
15+
- uses: hellofresh/action-changed-files@v3
16+
id: metadata
17+
with:
18+
pattern: docker/(?P<image_dir>\w+)/.*
19+
default-patterns: |
20+
meta.yml
21+
Dockerfile
22+
23+
update-docker:
24+
needs: [generate-matrix]
25+
strategy:
26+
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix-metadata) }}
27+
if: ${{ fromJson(needs.generate-matrix.outputs.matrix-metadata).include[0] }} # skip if the matrix is empty!
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: pietrobolcato/[email protected]
32+
id: metadata
33+
with:
34+
config: ${{ github.workspace }}/docker/${{ matrix.image_dir }}/meta.yml
35+
- name: Get date
36+
id: date
37+
run: |
38+
echo "DATE=$(date +"%Y-%m-%d")" >> $GITHUB_OUTPUT
39+
- name: Login to DockerHub
40+
#if: github.event_name != 'pull_request'
41+
uses: docker/login-action@v2
42+
with:
43+
username: ${{ secrets.DOCKERHUB_USERNAME }}
44+
password: ${{ secrets.DOCKERHUB_TOKEN }}
45+
- name: Build and push
46+
uses: docker/build-push-action@v4
47+
# only try building & pushing the container if parsing the metadata worked
48+
if: ${{ steps.metadata.outputs['container'] != '' }}
49+
with:
50+
context: docker/${{ matrix.image_dir }}
51+
# only push container to docker hub if not triggered from a PR
52+
push: ${{ github.event_name != 'pull_request' }}
53+
tags: ${{ steps.metadata.outputs['container'] }}
54+
build-args: |
55+
BUILD_DATE=${{ steps.date.outputs.DATE }}
56+
BUILD_TAG=${{ steps.metadata.outputs['version'] }}
57+
REPONAME=${{ steps.metadata.outputs['image_name'] }}

docker/annotate_cnvsv/Dockerfile

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
FROM --platform=linux/amd64 nciccbr/ccbr_ubuntu_base_20.04:v5
2+
3+
# build time variables
4+
ARG BUILD_DATE="000000"
5+
ENV BUILD_DATE=${BUILD_DATE}
6+
ARG BUILD_TAG="000000"
7+
ENV BUILD_TAG=${BUILD_TAG}
8+
ARG REPONAME="000000"
9+
ENV REPONAME=${REPONAME}
10+
11+
LABEL maintainer <[email protected]>
12+
13+
# Create Container filesystem specific
14+
# working directory and opt directories
15+
WORKDIR /opt2
16+
17+
###Create AnnotSV
18+
RUN wget https://github.com/lgmgeo/AnnotSV/archive/refs/tags/v3.3.6.tar.gz \
19+
&& tar -xvjf /opt2/3.3.6.tar.gz \
20+
&& rm /opt2/3.3.6.tar.gz
21+
ENV PATH="/opt2/AnnotSV-3.3.6/bin:$PATH"
22+
23+
##ClassifyCNV
24+
##Update the resources for ClassifyCNV
25+
RUN wget https://github.com/Genotek/ClassifyCNV/archive/refs/tags/v1.1.1.tar.gz \
26+
&& tar -xvjf /opt2/v1.1.1.tar.gz \
27+
&& rm /opt2/v1.1.1.tar.gz
28+
ENV PATH="/opt2/ClassifyCNV-1.1.1:$PATH"
29+
RUN update_clingen.sh
30+
31+
32+
COPY Dockerfile /opt2/Dockerfile_${REPONAME}.${BUILD_TAG}
33+
RUN chmod a+r /opt2/Dockerfile_${REPONAME}.${BUILD_TAG}
34+

docker/annotate_cnvsv/meta.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dockerhub_namespace: dnousome
2+
image_name: ccbr_annotate_cnvsv
3+
version: v0.0.1
4+
container: "$(dockerhub_namespace)/$(image_name):$(version)"

docker/lofreq/Dockerfile

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
FROM --platform=linux/amd64 ubuntu:22.04
2+
3+
# build time variables
4+
ARG BUILD_DATE="000000"
5+
ENV BUILD_DATE=${BUILD_DATE}
6+
ARG BUILD_TAG="000000"
7+
ENV BUILD_TAG=${BUILD_TAG}
8+
ARG REPONAME="000000"
9+
ENV REPONAME=${REPONAME}
10+
11+
LABEL maintainer <[email protected]>
12+
13+
# Create Container filesystem specific
14+
# working directory and opt directories
15+
16+
# This section installs system packages required for your project
17+
# If you need extra system packages add them here.
18+
RUN apt-get update \
19+
&& apt-get -y upgrade \
20+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
21+
automake \
22+
build-essential \
23+
curl \
24+
git \
25+
gcc \
26+
libbz2-dev \
27+
libcurl4-gnutls-dev \
28+
libgsl0-dev \
29+
libperl-dev \
30+
liblzma-dev \
31+
libncurses5-dev \
32+
libssl-dev \
33+
python3-dev \
34+
zlib1g-dev
35+
36+
RUN ln -s /usr/bin/python3.10 /usr/bin/python
37+
38+
WORKDIR /opt2
39+
40+
ARG htsversion=1.19
41+
42+
RUN curl -L https://github.com/samtools/htslib/releases/download/${htsversion}/htslib-${htsversion}.tar.bz2 | tar xj \
43+
&& cd htslib-${htsversion} \
44+
&& ./configure \
45+
&& make \
46+
&& make install
47+
48+
RUN curl -L https://github.com/samtools/bcftools/releases/download/${htsversion}/bcftools-${htsversion}.tar.bz2 | tar xj \
49+
&& cd bcftools-${htsversion} \
50+
&& ./configure && make && make install
51+
52+
RUN git clone https://github.com/CSB5/lofreq \
53+
&& cd lofreq \
54+
&& ./bootstrap \
55+
&& ./configure --with-htslib=/usr/local \
56+
&& make \
57+
&& make install
58+
59+
ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH

docker/lofreq/build.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Build image
2+
3+
docker build --platform linux/amd64 --tag ccbr_logan_base:v0.3.4 -f Dockerfile .
4+
5+
docker tag ccbr_lofreq:v0.0.1 dnousome/ccbr_lofreq:v0.0.1
6+
docker push dnousome/ccbr_lofreq:v0.0.1
7+
8+
docker push dnousome/ccbr_logan_base:latest
9+
10+
11+

docker/logan_base/meta.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dockerhub_namespace: dnousome
2+
image_name: ccbr_logan_base
3+
version: v0.3.4
4+
container: "$(dockerhub_namespace)/$(image_name):$(version)"

0 commit comments

Comments
 (0)