-
Notifications
You must be signed in to change notification settings - Fork 5
62 lines (57 loc) · 1.86 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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