You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-7
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
7
7
A docker environment for building **static** rust binaries for `x86_64`**linux** environments using **[musl](https://musl.libc.org/)**. Built daily via [github actions](https://github.com/clux/muslrust/actions).
8
8
9
-
Binaries compiled with `muslrust` are **light-weight**, call straight into the kernel without other system library dependencies, can be shipped to most linux distributions without compatibility issues, and can be inserted into lightweight docker images such as [static distroless](https://github.com/GoogleContainerTools/distroless/blob/main/base/README.md), [scratch](https://hub.docker.com/_/scratch), or [alpine](https://hub.docker.com/_/alpine) without further installs.
9
+
Binaries compiled with `muslrust` are **light-weight**, call straight into the kernel without other dynamic system library dependencies, can be shipped to most linux distributions without compatibility issues, and can be inserted as-is into lightweight docker images such as [static distroless](https://github.com/GoogleContainerTools/distroless/blob/main/base/README.md), [scratch](https://hub.docker.com/_/scratch), or [alpine](https://hub.docker.com/_/alpine).
10
10
11
11
The goal is to **simplify** the creation of small and **efficient cloud containers**, or **stand-alone linux binary releases**.
-[Kubernetes controller with actix-web using plain distroless/static](https://github.com/kube-rs/controller-rs/blob/main/Dockerfile)
36
34
-[Kubernetes reflector with axum using builder pattern](https://github.com/kube-rs/version-rs/blob/main/Dockerfile)
37
35
-[Kubernetes controller using cargo-chef for caching layers](https://github.com/qualified/ephemeron/blob/main/k8s/controller/Dockerfile)
38
36
-[Github release assets uploaded via github actions](https://github.com/kube-rs/kopium/blob/main/.github/workflows/release.yml)
39
37
40
-
The binaries and images for small apps generally end up around ~6MB compressed or ~20MB uncompressed without stripping.
38
+
The binaries and images for small apps generally end up `<10MB`compressed or `~20MB` uncompressed without stripping.
41
39
42
-
The **recommended** production image is **[static distroless](https://github.com/GoogleContainerTools/distroless/blob/main/base/README.md)** because it avoids you dealing with below SSL issues (common with `scratch`), and it disallows shelling in via`kubectl exec` (use `alpine`if you want this).
40
+
The **recommended** production image is [distroless static](https://github.com/GoogleContainerTools/distroless/tree/main/base) or [chainguard static](https://github.com/chainguard-images/images/tree/main/images/static) as these contain a non-root users + SSL certs (unlike `scratch`), and disallows shell access (use`kubectl debug`if you want this). See also [kube.rs security doc on base image recommendations](https://kube.rs/controllers/security/#base-images).
You can also hardcode this in your binary, or, more sensibly set it in your running docker image. The [openssl-probe crate](https://crates.io/crates/openssl-probe)can be also be used to detect where these reside. If you use [distroless:static](https://github.com/GoogleContainerTools/distroless/blob/main/base/README.md), you can avoid this.
137
+
These can be [hardcoded in your Dockerfile](https://docs.docker.com/engine/reference/builder/#env), or you can rely on the [openssl-probe crate](https://crates.io/crates/openssl-probe)to detect the cert location. You should not have to do this if you are using the static variants of `distroless` or `chainguard`.
140
138
141
139
### Diesel and PQ builds
142
140
@@ -159,7 +157,7 @@ When building locally, the permissions of the musl parts of the `./target` artif
159
157
160
158
### Debugging in blank containers
161
159
162
-
If you are running a plain alpine/scratch container with your musl binary in there, then you might need to compile with debug symbols, and set `ENV RUST_BACKTRACE=full`in your `Dockerfile`.
160
+
If you are running a plain alpine/scratch container with your musl binary in there, then you might need to compile with debug symbols, and set the `RUST_BACKTRACE=full`evar to see crashes.
163
161
164
162
In alpine, if this doesn't work (or fails to give you line numbers), try installing the `rust` package (via `apk`). This should not be necessary anymore though!
0 commit comments