Skip to content

Commit 2e273a4

Browse files
committed
minor doc tweaks
Signed-off-by: clux <[email protected]>
1 parent 1b52557 commit 2e273a4

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ test/zlibcrate/data.tar.gz
66
test/zlibcrate/output
77
test/pkgconf/Cargo.lock
88
test/pkgconf/target
9+
venv

README.md

+5-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
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).
88

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).
1010

1111
The goal is to **simplify** the creation of small and **efficient cloud containers**, or **stand-alone linux binary releases**.
1212

@@ -28,18 +28,16 @@ ldd target/x86_64-unknown-linux-musl/release/EXECUTABLE
2828
not a dynamic executable
2929
```
3030

31-
32-
3331
## Examples
3432

3533
- [Kubernetes controller with actix-web using plain distroless/static](https://github.com/kube-rs/controller-rs/blob/main/Dockerfile)
3634
- [Kubernetes reflector with axum using builder pattern](https://github.com/kube-rs/version-rs/blob/main/Dockerfile)
3735
- [Kubernetes controller using cargo-chef for caching layers](https://github.com/qualified/ephemeron/blob/main/k8s/controller/Dockerfile)
3836
- [Github release assets uploaded via github actions](https://github.com/kube-rs/kopium/blob/main/.github/workflows/release.yml)
3937

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.
4139

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).
4341

4442
## Available Tags
4543

@@ -136,7 +134,7 @@ export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
136134
export SSL_CERT_DIR=/etc/ssl/certs
137135
```
138136

139-
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`.
140138

141139
### Diesel and PQ builds
142140

@@ -159,7 +157,7 @@ When building locally, the permissions of the musl parts of the `./target` artif
159157

160158
### Debugging in blank containers
161159

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.
163161

164162
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!
165163

0 commit comments

Comments
 (0)