Skip to content

Commit

Permalink
Add .def file for apptainer build
Browse files Browse the repository at this point in the history
Fixes #5
  • Loading branch information
espenhgn committed Oct 1, 2024
1 parent 0842e7b commit 09e916b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/container_build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,9 @@ jobs:
ghcr.io/${{ github.repository_owner }}/mtag
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=pep440,pattern={{version}}
type=sha
type=raw,value=latest,enable={{is_default_branch}}
- name: Set up QEMU
Expand Down Expand Up @@ -98,7 +95,8 @@ jobs:
push_tags="$(printf $csv_tags | sed -e "s/mtag/mtag_sif/g")"
echo ${{ secrets.GITHUB_TOKEN }} | oras login --username ${{ github.repository_owner }} --password-stdin ghcr.io
docker pull kaczmarj/apptainer:latest
docker run --rm --privileged -v $(pwd):/work kaczmarj/apptainer build mtag.sif docker://"$first_tag"
# docker run --rm --privileged -v $(pwd):/work kaczmarj/apptainer build mtag.sif docker://"$first_tag"
docker run --rm --privileged -v $(pwd):/work kaczmarj/apptainer build -F --build-arg mtag_image="$first_tag" mtag.sif apptainer/mtag.def
oras push "$push_tags" mtag.sif
rm mtag.sif
shell: sh
File renamed without changes.
9 changes: 9 additions & 0 deletions apptainer/mtag.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Bootstrap: docker
From: {{ mtag_image }}

%post

%environment

%runscript
exec /opt/conda/bin/python /mtag/mtag.py "$@"

0 comments on commit 09e916b

Please sign in to comment.