Skip to content

Commit 88b1f67

Browse files
committed
building feos-nginx package
1 parent 7763596 commit 88b1f67

File tree

3 files changed

+122
-0
lines changed

3 files changed

+122
-0
lines changed
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: FeOS Nginx Container
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths-ignore:
8+
- 'docs/**'
9+
- '**/*.md'
10+
11+
jobs:
12+
build_nginx_container:
13+
permissions:
14+
contents: read
15+
packages: write
16+
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout Code
21+
uses: actions/checkout@v4
22+
23+
- uses: docker/metadata-action@v5
24+
id: meta
25+
with:
26+
images: |
27+
ghcr.io/ironcore-dev/feos/feos-nginx
28+
tags: |
29+
type=ref,event=branch
30+
type=sha,prefix={{branch}}-
31+
type=raw,value=latest,enable={{is_default_branch}}
32+
33+
- name: Set up Docker Buildx
34+
uses: docker/setup-buildx-action@v3
35+
36+
- name: Install Protobuf Compiler
37+
run: sudo apt-get update && sudo apt-get install protobuf-compiler -y
38+
39+
- name: Login to GitHub Container Registry
40+
uses: docker/login-action@v3
41+
with:
42+
registry: ghcr.io
43+
username: ${{ github.actor }}
44+
password: ${{ secrets.GITHUB_TOKEN }}
45+
46+
- name: Set up cargo cache
47+
uses: actions/cache@v4
48+
continue-on-error: false
49+
with:
50+
path: |
51+
~/.cargo/bin/
52+
~/.cargo/registry/index/
53+
~/.cargo/registry/cache/
54+
~/.cargo/git/db/
55+
target/
56+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
57+
restore-keys: ${{ runner.os }}-cargo-
58+
59+
- name: Run Tests
60+
run: make test
61+
62+
- name: Build build-container
63+
run: make build-container
64+
65+
- name: Set up kernel cache
66+
uses: actions/cache@v4
67+
continue-on-error: false
68+
with:
69+
path: |
70+
target/kernel/
71+
key: ${{ runner.os }}-kernel-${{ hashFiles('hack/kernel/**') }}
72+
restore-keys: ${{ runner.os }}-kernel-
73+
74+
- name: Build Kernel
75+
run: make kernel
76+
77+
- name: Build initramfs
78+
run: make initramfs
79+
80+
- name: Build UKI with secrets
81+
run: |
82+
CMDLINE="console=tty0 console=ttyS0,115200 earlyprintk=ttyS0,115200 consoleblank=0"
83+
echo $CMDLINE > target/cmdline
84+
mkdir -p keys
85+
echo "${{ secrets.SECUREBOOT_PRIVATEKEY }}" > keys/secureboot.key
86+
echo "${{ secrets.SECUREBOOT_CERTIFICATE }}" > keys/secureboot.pem
87+
openssl x509 -in keys/secureboot.pem -out keys/feos.crt -outform DER
88+
make uki
89+
90+
- name: Build nginx container
91+
run: make nginx
92+
93+
- name: Tag and push Docker image
94+
run: |
95+
# Tag the locally built image with the registry tags
96+
for tag in ${{ steps.meta.outputs.tags }}; do
97+
docker tag feos-nginx $tag
98+
done
99+
100+
# Push all tags
101+
for tag in ${{ steps.meta.outputs.tags }}; do
102+
docker push $tag
103+
done

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,8 @@ include hack/hack.mk
2222

2323
cli:
2424
cargo build --bin feos-cli
25+
26+
nginx: uki
27+
@echo "Building nginx container with FeOS UKI..."
28+
docker build -f hack/Dockerfile.nginx -t feos-nginx .
29+
@echo "Built feos-nginx container successfully"

hack/Dockerfile.nginx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM nginx:alpine
2+
3+
# Copy the UKI file to nginx html directory
4+
COPY target/uki.efi /usr/share/nginx/html/feos.uki
5+
6+
# Add MIME type for .uki files
7+
RUN echo "types {" > /etc/nginx/mime.types
8+
RUN echo " application/efi uki;" >> /etc/nginx/mime.types
9+
RUN echo "}" >> /etc/nginx/mime.types
10+
11+
# Create a simple index page
12+
RUN echo '<html><body><h1>FeOS UKI Server</h1><p><a href="/feos.uki">Download FeOS UKI (x86_64)</a></p></body></html>' > /usr/share/nginx/html/index.html
13+
14+
EXPOSE 80

0 commit comments

Comments
 (0)