Skip to content

Commit ba5e10a

Browse files
committed
make nginx
1 parent 1b976ce commit ba5e10a

File tree

2 files changed

+32
-25
lines changed

2 files changed

+32
-25
lines changed

.github/workflows/nginx-container.yaml

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
- name: Build initramfs
7878
run: make initramfs
7979

80-
- name: Build UKI
80+
- name: Build UKI with secrets
8181
run: |
8282
CMDLINE="console=tty0 console=ttyS0,115200 earlyprintk=ttyS0,115200 consoleblank=0"
8383
echo $CMDLINE > target/cmdline
@@ -87,29 +87,17 @@ jobs:
8787
openssl x509 -in keys/secureboot.pem -out keys/feos.crt -outform DER
8888
make uki
8989
90-
- name: Create Dockerfile for nginx container
90+
- name: Build nginx container
91+
run: make nginx
92+
93+
- name: Tag and push Docker image
9194
run: |
92-
cat > Dockerfile.nginx << 'EOF'
93-
FROM nginx:alpine
94-
95-
# Copy the UKI file to nginx html directory
96-
COPY target/uki.efi /usr/share/nginx/html/feos.uki
97-
98-
# Add MIME type for .uki files
99-
RUN echo 'application/efi uki;' >> /etc/nginx/mime.types
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
10099
101-
# Create a simple index page
102-
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
103-
104-
EXPOSE 80
105-
EOF
106-
107-
- name: Build and push Docker image
108-
uses: docker/build-push-action@v5
109-
with:
110-
context: .
111-
file: ./Dockerfile.nginx
112-
platforms: linux/amd64,linux/arm64
113-
push: true
114-
tags: ${{ steps.meta.outputs.tags }}
115-
labels: ${{ steps.meta.outputs.labels }}
100+
# Push all tags
101+
for tag in ${{ steps.meta.outputs.tags }}; do
102+
docker push $tag
103+
done

Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,22 @@ 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+
@cat > Dockerfile.nginx << 'EOF'
29+
FROM nginx:alpine
30+
31+
# Copy the UKI file to nginx html directory
32+
COPY target/uki.efi /usr/share/nginx/html/feos.uki
33+
34+
# Add MIME type for .uki files
35+
RUN echo 'application/efi uki;' >> /etc/nginx/mime.types
36+
37+
# Create a simple index page
38+
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
39+
40+
EXPOSE 80
41+
EOF
42+
docker build -f Dockerfile.nginx -t feos-nginx .
43+
@echo "Built feos-nginx container successfully"

0 commit comments

Comments
 (0)