Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker container #59

Merged
merged 3 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Publish Docker image

on:
pull_request:
paths:
- "Dockerfile"
- "env.yaml"
- ".github/workflows/docker-publish.yml"
- "zamp/**"
- "setup.py"
- "!docs/**"
- "!*.md"
- "!LICENSE"
push:
branches: [main]
paths:
- "Dockerfile"
- "env.yaml"
- ".github/workflows/docker-publish.yml"
- "zamp/**"
- "setup.py"
- "!docs/**"
- "!*.md"
- "!LICENSE"

release:
types: [published]

jobs:
push_to_registry:
if: github.repository == 'metagenlab/zAMP'
name: Build + Push Docker image
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push dev image
uses: docker/build-push-action@v6
if: github.event_name == 'push'
with:
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/metagenlab/zamp:dev
metagenlab/zamp:dev

- name: Push release image
uses: docker/build-push-action@v6
if: github.event_name == 'release'
with:
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/metagenlab/zamp:${{ github.event.release.tag_name }}
ghcr.io/metagenlab/zamp:latest
metagenlab/zamp:${{ github.event.release.tag_name }}
metagenlab/zamp:latest
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM mambaorg/micromamba
LABEL org.opencontainers.image.source=https://github.com/metagenlab/zAMP
LABEL org.opencontainers.image.description="Snakemake pipeline for convenient amplicon metagenomics anlysis"
LABEL org.opencontainers.image.licenses=MIT
ENV LANG=C.UTF-8
ENV SHELL=/bin/bash

USER root
ENV APT_PKGS="procps ca-certificates"
RUN apt-get update \
&& apt-get install -y --no-install-recommends ${APT_PKGS} \
&& apt-get clean \
&& rm -rf /var/lib/apt /var/lib/dpkg /var/lib/cache /var/lib/log
USER $MAMBA_USER

COPY --chown=$MAMBA_USER:$MAMBA_USER . /pkg
RUN micromamba config set extract_threads 1 && \
micromamba install -n base -y -f /pkg/env.yaml && \
micromamba clean -afy
ARG MAMBA_DOCKERFILE_ACTIVATE=1
RUN pip install /pkg --no-deps --no-build-isolation --no-cache-dir -vvv
ENV PATH="/opt/conda/bin:$PATH" XDG_CACHE_HOME=/tmp
16 changes: 16 additions & 0 deletions env.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
channels:
- conda-forge
- bioconda
dependencies:
- apptainer =1.3.2
- python =3.12
- pip
- Click =8.1.3
- metasnek =0.0.8
- snaketool-utils =0.0.5
- snakemake-minimal =8.24
- snakemake-executor-plugin-slurm =0.11.2
- attrmap =0.0.7
- biopython =1.83
- pandas =2.2.1