diff --git a/.github/workflows/build-zerofs.yml b/.github/workflows/build-zerofs.yml new file mode 100644 index 000000000..46a84277a --- /dev/null +++ b/.github/workflows/build-zerofs.yml @@ -0,0 +1,34 @@ +name: Build and publish ZeroFS container image + +on: + workflow_dispatch: + inputs: + version: + description: 'Image version (e.g., 0.1.0)' + required: true + zfsversion : + description : 'add the latest version of zerofs https://github.com/Barre/ZeroFS/releases (e.g., 0.15.4)' + required : true + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker Login + uses: docker/login-action@v3 + with: + registry: public.cr.seqera.io + username: ${{ vars.SEQERA_PUBLIC_CR_USERNAME }} + password: ${{ secrets.SEQERA_PUBLIC_CR_PASSWORD }} + + - name: Build and Push Image to public.cr.seqera.io + run: | + cd zerofs + make build version=${{ github.event.inputs.version }} zfs_version=${{ github.event.inputs.zfsversion }} diff --git a/zerofs/Dockerfile b/zerofs/Dockerfile new file mode 100644 index 000000000..611a20b7a --- /dev/null +++ b/zerofs/Dockerfile @@ -0,0 +1,8 @@ +FROM ubuntu:22.04 +ARG version +RUN apt-get update && apt-get install -y ca-certificates file curl tar +RUN curl -LO https://github.com/Barre/ZeroFS/releases/download/v${version}/zerofs-pgo-multiplatform.tar.gz \ + && tar -xzf zerofs-pgo-multiplatform.tar.gz \ + && cp zerofs-linux-amd64-pgo /usr/local/bin/zerofs \ + && chmod +x /usr/local/bin/zerofs + diff --git a/zerofs/Makefile b/zerofs/Makefile new file mode 100644 index 000000000..93c594d0d --- /dev/null +++ b/zerofs/Makefile @@ -0,0 +1,10 @@ +version ?= 0.1.0 +zfs_version ?= 0.15.5 + +build: + docker buildx build \ + --push \ + --platform linux/amd64,linux/arm64 \ + --build-arg version=${zfs_version} \ + --tag cr.seqera.io/public/zerofs:v${version}-zfs-${zfs_version} \ + .