Publish Hermit environment #414
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Hermit environment | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * 6' | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
publish_image: | |
name: Publish container image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: hermit-os | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create dockerfile for Ubuntu | |
run: | | |
cat << END > Dockerfile | |
FROM rust:bookworm as builder | |
RUN apt update | |
RUN apt install -y --no-install-recommends libcap-ng-dev libseccomp-dev | |
RUN cargo install --git https://gitlab.com/virtio-fs/virtiofsd.git | |
FROM ubuntu:latest | |
RUN apt update | |
RUN apt install -y --no-install-recommends libcap-ng0 libseccomp2 qemu-system-x86 net-tools | |
COPY --from=builder /usr/local/cargo/bin/virtiofsd /usr/bin/virtiofsd | |
RUN chmod 0755 /usr/bin/virtiofsd | |
END | |
- name: Build and push container | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
push: true | |
tags: ghcr.io/hermit-os/hermit_env:latest | |
- name: Create dockerfile for Alpine | |
run: | | |
cat << END > Dockerfile | |
FROM alpine:latest as builder | |
RUN apk add --no-cache rust cargo libseccomp-dev libcap-ng-dev | |
RUN cargo install --git https://gitlab.com/virtio-fs/virtiofsd.git | |
FROM alpine:latest | |
RUN apk add --no-cache qemu qemu-system-x86_64 libseccomp libcap-ng | |
COPY --from=builder /root/.cargo/bin/virtiofsd /usr/bin/virtiofsd | |
RUN chmod 0755 /usr/bin/virtiofsd | |
END | |
- name: Build and push container | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
push: true | |
tags: ghcr.io/hermit-os/hermit_env_alpine:latest | |