From a82b2d016a5326af0cef8b5d9711ee45422f7b91 Mon Sep 17 00:00:00 2001 From: Ruben Nijveld Date: Fri, 12 Apr 2024 12:35:23 +0200 Subject: [PATCH] Add cleanup, add usage and readme, update build schedule --- .github/workflows/build-push.yml | 2 +- .github/workflows/container-cleanup.yml | 16 ++++++++++ README.md | 41 +++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/container-cleanup.yml diff --git a/.github/workflows/build-push.yml b/.github/workflows/build-push.yml index f7dc7d3..7bd2591 100644 --- a/.github/workflows/build-push.yml +++ b/.github/workflows/build-push.yml @@ -9,7 +9,7 @@ on: branches: - main schedule: - - cron: '15 2 * * SUN' + - cron: '30 2 * * SUN' jobs: build-and-push: diff --git a/.github/workflows/container-cleanup.yml b/.github/workflows/container-cleanup.yml new file mode 100644 index 0000000..78a20a0 --- /dev/null +++ b/.github/workflows/container-cleanup.yml @@ -0,0 +1,16 @@ +name: Container Registry Cleanup + +permissions: + contents: read + packages: write + +on: + workflow_dispatch: + schedule: + - cron: '30 2 * * MON' + +jobs: + untagged-cleanup: + uses: "tweedegolf/actions-container-helpers/.github/workflows/container-untagged-cleanup.yml@main" + with: + package: rust-dev diff --git a/README.md b/README.md index c6aae30..74ad5c0 100644 --- a/README.md +++ b/README.md @@ -1 +1,42 @@ # Rust development Docker images +This development image contains a Rust compiler toolchain and a C/C++ compiler +toolchain. It also includes debugging and analysis tools such as lldb, gdb and +valgrind. This image is intended for development only. For production use-cases +you should just start with the base debian image and add your compiled binaries +to it (and install any optional library dependencies). Currently these versions +are supported: + +* Rust stable: `stable` (`ghcr.io/tweedegolf/rust-dev:stable`) +* Rust 1.77: `1.77`, `latest` (`ghcr.io/tweedegolf/rust-dev:1.77`) +* Rust 1.76: `1.76` (`ghcr.io/tweedegolf/rust-dev:1.76`) +* Rust beta: `beta` (`ghcr.io/tweedegolf/rust-dev:beta`) +* Rust nightly: `nightly` (`ghcr.io/tweedegolf/rust-dev:nightly`) + +Furthermore, each version also has a `-node` variant that includes the latest +LTS release of node.js and yarn. + +## Usage in docker compose + +```yaml +services: + # ... + app: + image: ghcr.io/tweedegolf/rust-dev:stable + # You will have to define the USER_ID and GROUP_ID environment variables + # as `export USER_ID=$(id -u)` and `export GROUP_ID=$(id -g)` if they + # have not already been defined previously + user: "$USER_ID:$GROUP_ID" + volumes: [.:/app] + # Change to whatever command you wish to use instead of cargo watch + command: [cargo, watch, -x, "run"] + working_dir: /app + environment: + # This allows sharing cargo download even across multiple containers + CARGO_HOME: ".cargo" + # Create a separate target dir inside the container to prevent + # waiting for rust-analyzer on your host + CARGO_TARGET_DIR: "target-docker" + # Optionally define some ports to use externally + ports: ["127.0.0.1:8000:8000"] + + # ...