Docker image for building rust projects. https://git.kemitix.net/kemitix/rust
Find a file
kemitix e3f9890172
All checks were successful
/ test (map[name:stable]) (push) Successful in 51s
/ test (map[name:nightly]) (push) Successful in 51s
docs: Update README.md
Signed-off-by: kemitix <pcampbell@kemitix.net>
2025-02-02 15:48:22 +00:00
.forgejo/workflows feat: push-next uses 'latest' image 2025-01-16 08:40:00 +00:00
scripts feat: add check-for-ignored script 2025-01-13 21:40:51 +00:00
src feat: remove openssl transitive dependency 2025-01-18 20:53:11 +00:00
.gitignore build: add 'mise run test' 2025-01-11 18:26:16 +00:00
Cargo.toml feat: remove openssl transitive dependency 2025-01-18 20:53:11 +00:00
Dockerfile chore: Bump rust from 1.84.0 to 1.84.1 and cargo-binstall from 1.10.19 to 1.10.22 2025-01-31 12:26:34 +00:00
justfile feat: remove openssl transitive dependency 2025-01-18 20:53:11 +00:00
LICENSE Initial commit 2024-05-16 17:59:27 +01:00
mise.toml build: add 'mise run test' 2025-01-11 18:26:16 +00:00
README.md docs: Update README.md 2025-02-02 15:48:22 +00:00
renovate.json Add renovate.json 2024-08-02 18:16:19 +00:00

docker-builder-rust

Docker image for building Rust projects with Cargo.

Usage

In a Forgejo action file, e.g. .forgejo/workflows/test.yml:

on: [push]
jobs:
  test:
    runs-on: docker
    container:
      image:
        git.kemitix.net/kemitix/rust:latest
    strategy:
      matrix:
        toolchain:
          - name: stable
          - name: nightly
    steps:
      - name: Test
        run: cargo +${{ matrix.toolchain.name }} test
      - name: Build (with stable as default)
        run: cargo build

Toolchains

The available toolchain in the image are:

  • nightly
  • stable

Contents

  • nodejs
  • rust
  • git
  • cargo
  • cargo-binstall
  • cargo-mutants
  • cargo-chef
  • cargo-hack
  • release-plz
  • dbus-dev
  • perl

Scripts

  • check-for-ignored

Checks for files that are being tracked by Git but should be ignored according to the .gitignore file.

Usage

steps:
  - name: Check for Ignored Files
    run: check-for-ignored

Caveats

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.

If possible, use rustls instead.

vendoered native-tls

This crate must use the vendored feature in order to compile in the Alpine Linux image.

native-tls = { version = "0.2", features = ["vendored"] }

Don't use openssl

Check that none of your dependencies require openssl:

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.

reqwest = { version = "0.12", default-features = false, features = [
  "json",
  "rustls-tls",
] }