Skip to content

Commit

Permalink
add qctool container
Browse files Browse the repository at this point in the history
  • Loading branch information
gmauro committed Mar 21, 2024
1 parent dc3dd3f commit 746605f
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 1 deletion.
60 changes: 60 additions & 0 deletions .github/workflows/docker-publish-qctool.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Docker

on:
push:
branches: [ "main" ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
pull_request:
branches: [ "main" ]

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}/qctool
IMAGE_TAG: 2.2.0


jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Lint Dockerfile
uses: hadolint/[email protected]
with:
dockerfile: qctool/Dockerfile

# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
with:
context: qctool/
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# containers

Container recipes used to build images for our bioinformatics/statistical analysis.
Container recipes that are used to build the images for our bioinformatics/statistical pipelines.
32 changes: 32 additions & 0 deletions qctool/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# hadolint global ignore=SC2086,DL3033,SC1091
# Dockerfile

# https://hub.docker.com/_/rockylinux
FROM rockylinux:8
ENV container docker

WORKDIR "/lib/systemd/system/sysinit.target.wants/"
RUN (for i in *; do [ $i == \
systemd-tmpfiles-setup.service ] || rm -f $i; done); \
rm -f /lib/systemd/system/multi-user.target.wants/*;\
rm -f /etc/systemd/system/*.wants/*;\
rm -f /lib/systemd/system/local-fs.target.wants/*; \
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
rm -f /lib/systemd/system/basic.target.wants/*;\
rm -f /lib/systemd/system/anaconda.target.wants/*;
VOLUME [ "/sys/fs/cgroup" ]

RUN yum -y install wget ca-certificates gcc lapack; yum clean all;

# Install qctool 2
WORKDIR "/tmp/"
RUN wget -q https://www.well.ox.ac.uk/~gav/resources/qctool_v2.2.0-CentOS_Linux7.8.2003-x86_64.tgz \
&& tar -xvf qctool_v2.2.0-CentOS_Linux7.8.2003-x86_64.tgz && rm -f qctool_v2.2.0-CentOS_Linux7.8.2003-x86_64.tgz \
&& mv qctool_v2.2.0-CentOS\ Linux7.8.2003-x86_64/qctool /usr/local/bin/ && chmod a+rwx /usr/local/bin/qctool \
&& rm -rf qctool_v2.2.0-CentOS\ Linux7.8.2003-x86_64

ENV PATH=/usr/local/bin:$PATH

CMD ["/usr/sbin/init"]

0 comments on commit 746605f

Please sign in to comment.