2024-05-16 18:52:20 +01:00
|
|
|
# docker-builder-rust
|
2024-05-16 17:59:27 +01:00
|
|
|
|
2024-05-16 18:52:20 +01:00
|
|
|
Docker image for building Rust projects with Cargo.
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
In a Forgejo action file, e.g. `.forgejo/workflows/test.yml`:
|
|
|
|
|
|
|
|
```yml
|
|
|
|
on: [push]
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: docker
|
2025-01-12 11:18:19 +00:00
|
|
|
container:
|
|
|
|
image:
|
|
|
|
git.kemitix.net/kemitix/rust:v3.0.0
|
2024-05-16 18:52:20 +01:00
|
|
|
steps:
|
2025-01-12 11:18:19 +00:00
|
|
|
- name: test with nightly
|
|
|
|
run: cargo +nightly test
|
|
|
|
- name: build with v1.74.1
|
|
|
|
run: cargo +1.74.1 cargo build
|
|
|
|
- name: test with stable
|
|
|
|
run: cargo test
|
2024-05-16 18:52:20 +01:00
|
|
|
```
|
|
|
|
|
2025-01-12 11:18:19 +00:00
|
|
|
## Toolchains
|
2024-09-16 16:18:49 +01:00
|
|
|
|
2025-01-12 11:18:19 +00:00
|
|
|
The available toolchain in the image are:
|
2024-09-16 16:18:49 +01:00
|
|
|
|
2025-01-12 11:18:19 +00:00
|
|
|
- `nightly`
|
|
|
|
- stable
|
|
|
|
- 1.74.1
|
2024-09-16 16:18:49 +01:00
|
|
|
|
2024-05-16 18:52:20 +01:00
|
|
|
## Contents
|
|
|
|
|
|
|
|
- nodejs
|
|
|
|
- rust
|
2024-06-13 19:38:47 +01:00
|
|
|
- git
|
2024-05-16 18:52:20 +01:00
|
|
|
- cargo
|
|
|
|
- cargo-binstall
|
2024-11-14 09:08:24 +00:00
|
|
|
- cargo-mutants
|
|
|
|
- cargo-chef
|
|
|
|
- cargo-hack
|
|
|
|
- release-plz
|
2025-01-18 20:19:49 +00:00
|
|
|
- dbus-dev
|
2025-01-14 20:59:32 +00:00
|
|
|
- perl
|
2025-01-13 09:04:18 +00:00
|
|
|
|
|
|
|
### Scripts
|
|
|
|
|
|
|
|
- `check-for-ignored`
|
|
|
|
|
|
|
|
Checks for files that are being tracked by Git but should be ignored according
|
|
|
|
to the `.gitignore` file.
|
|
|
|
|
|
|
|
#### Usage
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
steps:
|
|
|
|
- name: Check for Ignored Files
|
|
|
|
run: check-for-ignored
|
|
|
|
```
|
2025-01-14 20:59:32 +00:00
|
|
|
|
|
|
|
## Caveats
|
|
|
|
|
2025-01-18 20:19:49 +00:00
|
|
|
### openssl
|
|
|
|
|
|
|
|
The alpine linux install doesn't build with this dependency. You can either compile `native-tls` with the `vendored` feature, or not use `openssl`.
|
|
|
|
|
|
|
|
#### vendoered native-tls
|
2025-01-14 20:59:32 +00:00
|
|
|
|
|
|
|
This crate *must* use the `vendored` feature in order to compile in the Alpine Linux image.
|
|
|
|
|
|
|
|
```toml
|
|
|
|
native-tls = { version = "0.2", features = ["vendored"] }
|
|
|
|
```
|
2025-01-18 20:19:49 +00:00
|
|
|
|
|
|
|
#### Don't use `openssl`
|
|
|
|
|
|
|
|
Check that none of your dependencies require `openssl`:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
cargo tree --edges normal -i openssl
|
|
|
|
```
|
|
|
|
|
|
|
|
This will list the tree of dependencies that are bringing in `openssl`.
|
|
|
|
|
|
|
|
If you do need ssl/tls, try using `rustls`. e.g.
|
|
|
|
|
|
|
|
```toml
|
|
|
|
reqwest = { version = "0.12", default-features = false, features = [
|
|
|
|
"json",
|
|
|
|
"rustls-tls",
|
|
|
|
] }
|
|
|
|
```
|