Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion httpserver-java17-springboot3.2.x/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Lines in the `Kraftfile` have the following roles:

* `spec: v0.6`: The current `Kraftfile` specification version is `0.6`.

* `runtime: java:17`: The Unikraft runtime kernel to use is Java.
* `runtime: base-compat:latest`: The runtime kernel to use is the base compatibility kernel.

* `rootfs: ./Dockerfile`: Build the app root filesystem using the `Dockerfile`.

Expand Down
32 changes: 32 additions & 0 deletions httpserver-nginx-vite-vanilla/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,38 @@ RUN set -xe; \
npm ci; \
npm run build

FROM nginx:1.25.3-bookworm AS nginx

RUN set -xe; \
rm -f /var/log/nginx/access.log; \
rm -f /var/log/nginx/error.log; \
touch /var/log/nginx/access.log; \
touch /var/log/nginx/error.log \
;

FROM scratch

# Nginx binaries, modules, configuration, log and runtime files
COPY --from=nginx /usr/sbin/nginx /usr/bin/nginx
COPY --from=nginx /usr/lib/nginx /usr/lib/nginx
COPY --from=nginx /etc/nginx /etc/nginx
COPY --from=nginx /etc/passwd /etc/passwd
COPY --from=nginx /etc/group /etc/group
COPY --from=nginx /var/log/nginx /var/log/nginx
COPY --from=nginx /var/cache/nginx /var/cache/nginx
COPY --from=nginx /var/run /var/run

# Libraries
COPY --from=nginx /lib/x86_64-linux-gnu/libcrypt.so.1 /lib/x86_64-linux-gnu/libcrypt.so.1
COPY --from=nginx /lib/x86_64-linux-gnu/libpcre2-8.so.0 /lib/x86_64-linux-gnu/libpcre2-8.so.0
COPY --from=nginx /lib/x86_64-linux-gnu/libssl.so.3 /lib/x86_64-linux-gnu/libssl.so.3
COPY --from=nginx /lib/x86_64-linux-gnu/libcrypto.so.3 /lib/x86_64-linux-gnu/libcrypto.so.3
COPY --from=nginx /lib/x86_64-linux-gnu/libz.so.1 /lib/x86_64-linux-gnu/libz.so.1
COPY --from=nginx /lib/x86_64-linux-gnu/libc.so.6 /lib/x86_64-linux-gnu/libc.so.6
COPY --from=nginx /lib64/ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2
COPY --from=nginx /etc/ld.so.cache /etc/ld.so.cache

# Custom configuration files, including using a single process for Nginx
COPY ./rootfs/ /

COPY --from=build /app/dist /wwwroot
2 changes: 1 addition & 1 deletion httpserver-nginx-vite-vanilla/Kraftfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ spec: v0.6

name: nginx-vite-vanilla

runtime: nginx:latest
runtime: base-compat:latest

labels:
cloud.unikraft.v1.instances/scale_to_zero.policy: "on"
Expand Down
2 changes: 1 addition & 1 deletion httpserver-nginx-vite-vanilla/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Lines in the `Kraftfile` have the following roles:

* `spec: v0.6`: The current `Kraftfile` specification version is `0.6`.

* `runtime: nginx:latest`: The nginx kernel to use.
* `runtime: base-compat:latest`: The runtime kernel to use is the base compatibility kernel.

* `rootfs: ./Dockerfile`: Build the app root filesystem using the `Dockerfile`.

Expand Down
31 changes: 31 additions & 0 deletions httpserver-nginx-vite-vanilla/rootfs/etc/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
worker_processes 1;
daemon off;
master_process off;
user root root;

events {
worker_connections 64;
}

http {
include mime.types;
default_type application/octet-stream;

open_file_cache max=10000 inactive=30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;

error_log stderr error;
access_log off;

keepalive_timeout 10s;
keepalive_requests 10000;
send_timeout 10s;

server {
listen 8080;
server_name localhost;
root /wwwroot;
index index.html;
}
}
25 changes: 25 additions & 0 deletions httpserver-nginx-vite-vanilla/rootfs/wwwroot/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>

<p><em>Thank you for using nginx.</em></p>
</body>
</html>
2 changes: 1 addition & 1 deletion httpserver-node21-nextjs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Lines in the `Kraftfile` have the following roles:

* `spec: v0.6`: The current `Kraftfile` specification version is `0.6`.

* `runtime: node:21`: The Unikraft runtime kernel to use is Node 21.
* `runtime: base-compat:latest`: The runtime kernel to use is the base compatibility kernel.

* `rootfs: ./Dockerfile`: Build the app root filesystem using the `Dockerfile`.

Expand Down
2 changes: 1 addition & 1 deletion httpserver-node21-sveltekit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ Lines in the `Kraftfile` have the following roles:

* `spec: v0.6`: The current `Kraftfile` specification version is `0.6`.

* `runtime: node:21`: The Unikraft runtime kernel to use is Node 21.
* `runtime: base-compat:latest`: The runtime kernel to use is the base compatibility kernel.

* `rootfs: ./Dockerfile`: Build the app root filesystem using the `Dockerfile`.

Expand Down
2 changes: 1 addition & 1 deletion httpserver-python3.12-django5.0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Lines in the `Kraftfile` have the following roles:

* `spec: v0.6`: The current `Kraftfile` specification version is `0.6`.

* `runtime: python:3.12`: The Unikraft runtime kernel to use is Python 3.12.
* `runtime: base-compat:latest`: The runtime kernel to use is the base compatibility kernel.

* `rootfs: ./Dockerfile`: Build the app root filesystem using the `Dockerfile`.

Expand Down
2 changes: 1 addition & 1 deletion httpserver-python3.12-flask3.0-sqlite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Lines in the `Kraftfile` have the following roles:

* `spec: v0.6`: The current `Kraftfile` specification version is `0.6`.

* `runtime: python:3.12`: The Unikraft runtime kernel to use is Python 3.12.
* `runtime: base-compat:latest`: The runtime kernel to use is the base compatibility kernel.

* `rootfs: ./Dockerfile`: Build the app root filesystem using the `Dockerfile`.

Expand Down
2 changes: 1 addition & 1 deletion httpserver-python3.12-flask3.0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Lines in the `Kraftfile` have the following roles:

* `spec: v0.6`: The current `Kraftfile` specification version is `0.6`.

* `runtime: python:3.12`: The Unikraft runtime kernel to use is Python 3.12.
* `runtime: base-compat:latest`: The runtime kernel to use is the base compatibility kernel.

* `rootfs: ./Dockerfile`: Build the app root filesystem using the `Dockerfile`.

Expand Down
2 changes: 1 addition & 1 deletion httpserver-python3.12/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Lines in the `Kraftfile` have the following roles:

* `spec: v0.6`: The current `Kraftfile` specification version is `0.6`.

* `runtime: python:3.12`: The Unikraft runtime kernel to use is Python 3.12.
* `runtime: base-compat:latest`: The runtime kernel to use is the base compatibility kernel.

* `rootfs: ./Dockerfile`: Build the app root filesystem using the `Dockerfile`.

Expand Down
35 changes: 34 additions & 1 deletion httpserver-rust-trunkrs-leptos/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.85.0-slim-bullseye AS builder
FROM rust:1.88.0-slim-bullseye AS builder
RUN rustup target add wasm32-unknown-unknown && cargo install wasm-bindgen-cli && cargo install --locked trunk

# Set up the working directory in the container
Expand All @@ -17,9 +17,42 @@ RUN trunk build --config ./frontend/Trunk.toml --release

EXPOSE 8080

FROM nginx:1.25.3-bookworm AS nginx

RUN set -xe; \
rm -f /var/log/nginx/access.log; \
rm -f /var/log/nginx/error.log; \
touch /var/log/nginx/access.log; \
touch /var/log/nginx/error.log \
;

# Use a smaller base image for the final runtime
# FROM nginx:1.27.4-alpine
FROM scratch

# Nginx binaries, modules, configuration, log and runtime files
COPY --from=nginx /usr/sbin/nginx /usr/bin/nginx
COPY --from=nginx /usr/lib/nginx /usr/lib/nginx
COPY --from=nginx /etc/nginx /etc/nginx
COPY --from=nginx /etc/passwd /etc/passwd
COPY --from=nginx /etc/group /etc/group
COPY --from=nginx /var/log/nginx /var/log/nginx
COPY --from=nginx /var/cache/nginx /var/cache/nginx
COPY --from=nginx /var/run /var/run

# Libraries
COPY --from=nginx /lib/x86_64-linux-gnu/libcrypt.so.1 /lib/x86_64-linux-gnu/libcrypt.so.1
COPY --from=nginx /lib/x86_64-linux-gnu/libpcre2-8.so.0 /lib/x86_64-linux-gnu/libpcre2-8.so.0
COPY --from=nginx /lib/x86_64-linux-gnu/libssl.so.3 /lib/x86_64-linux-gnu/libssl.so.3
COPY --from=nginx /lib/x86_64-linux-gnu/libcrypto.so.3 /lib/x86_64-linux-gnu/libcrypto.so.3
COPY --from=nginx /lib/x86_64-linux-gnu/libz.so.1 /lib/x86_64-linux-gnu/libz.so.1
COPY --from=nginx /lib/x86_64-linux-gnu/libc.so.6 /lib/x86_64-linux-gnu/libc.so.6
COPY --from=nginx /lib64/ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2
COPY --from=nginx /etc/ld.so.cache /etc/ld.so.cache

# Custom configuration files, including using a single process for Nginx
COPY ./rootfs/ /

COPY --from=builder /usr/src/frontend/frontend/nginx.conf /etc/nginx/nginx.conf
COPY --from=builder /usr/src/frontend/frontend/dist /usr/share/nginx/html/

2 changes: 1 addition & 1 deletion httpserver-rust-trunkrs-leptos/Kraftfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
spec: v0.6

runtime: nginx:latest
runtime: base-compat:latest

labels:
cloud.unikraft.v1.instances/scale_to_zero.policy: "on"
Expand Down
31 changes: 31 additions & 0 deletions httpserver-rust-trunkrs-leptos/rootfs/rootfs/etc/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
worker_processes 1;
daemon off;
master_process off;
user root root;

events {
worker_connections 64;
}

http {
include mime.types;
default_type application/octet-stream;

open_file_cache max=10000 inactive=30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;

error_log stderr error;
access_log off;

keepalive_timeout 10s;
keepalive_requests 10000;
send_timeout 10s;

server {
listen 8080;
server_name localhost;
root /wwwroot;
index index.html;
}
}
25 changes: 25 additions & 0 deletions httpserver-rust-trunkrs-leptos/rootfs/rootfs/wwwroot/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>

<p><em>Thank you for using nginx.</em></p>
</body>
</html>
2 changes: 1 addition & 1 deletion imaginary/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ You can customize the command line options used to start the service, by updatin
```yaml
spec: v0.6

runtime: imaginary:1.2
runtime: base-compat:latest

cmd: ["/usr/bin/imaginary", "-p", "8080"]
```
Expand Down
2 changes: 1 addition & 1 deletion ruby3.2-rails/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Lines in the `Kraftfile` have the following roles:

* `spec: v0.6`: The current `Kraftfile` specification version is `0.6`.

* `runtime: ruby:3.2`: The Unikraft runtime kernel to use is Ruby 3.2.
* `runtime: base-compat:latest`: The runtime kernel to use is the base compatibility kernel.

* `rootfs: ./Dockerfile`: Build the app root filesystem using the `Dockerfile`.

Expand Down
2 changes: 1 addition & 1 deletion spin-wagi-http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Lines in the `Kraftfile` have the following roles:

* `spec: v0.6`: The current `Kraftfile` specification version is `0.6`.

* `runtime: spin:latest`: The Unikraft runtime kernel to use is Spin.
* `runtime: base-compat:latest`: The runtime kernel to use is the base compatibility kernel.

* `rootfs: ./Dockerfile`: Build the app root filesystem using the `Dockerfile`.

Expand Down