Add Pterodactyl Rust Docker image and workflow#54
Add Pterodactyl Rust Docker image and workflow#54infnibor wants to merge 2 commits intobongodevs:masterfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughAdds a GitHub Actions workflow to build and push multi-architecture Rust 1.93 Docker images to GHCR, plus a Dockerfile and an entrypoint script to prepare the container runtime and transform/execute startup commands. Changes
Sequence Diagram(s)sequenceDiagram
participant GH as GitHub Actions Runner
participant Repo as Repository (checkout)
participant QEMU as QEMU Setup
participant Buildx as Docker Buildx
participant GHCR as GitHub Container Registry
participant Image as Multi-arch Image
GH->>Repo: checkout repo
GH->>QEMU: setup qemu-user-static (arm64)
GH->>Buildx: initialize buildx
GH->>GHCR: docker/login using GITHUB_TOKEN
GH->>Buildx: docker/metadata-action -> generate tags (1.93, latest)
GH->>Buildx: build-push (linux/amd64, linux/arm64) with cache
Buildx->>GHCR: push images
GHCR->>Image: store image artifacts
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds a new Pterodactyl “yolk” (Docker image + build workflow) for running/building Rust-based servers within the Rustalink repository.
Changes:
- Added a Pterodactyl-focused Rust Docker image (Rust 1.93) with required build/runtime dependencies and
tinias init. - Added a Pterodactyl-style entrypoint that expands panel variables and runs the configured startup command.
- Added a GitHub Actions workflow to build and publish the multi-arch image to GHCR.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| docker/pterodactyl/rust/entrypoint.sh | Entrypoint script that computes INTERNAL_IP and executes the Pterodactyl STARTUP command. |
| docker/pterodactyl/rust/1.93/Dockerfile | Defines the Rust 1.93 Pterodactyl image with dependencies, non-root user, and tini. |
| .github/workflows/pterodactyl-rust-yolks.yml | CI workflow to build/push the Pterodactyl Rust image to GHCR with version + latest tags. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (3)
docker/pterodactyl/rust/1.93/Dockerfile (1)
1-1:--platform=$TARGETOS/$TARGETARCHis redundant.
$TARGETOS/$TARGETARCHis equivalent to the already-default$TARGETPLATFORMthat buildx uses for the target stage, and it drops thevariantcomponent (matters for e.g.linux/arm/v7, irrelevant for the amd64/arm64 targets you build today). Since buildx already resolves the base image per target when no--platformis set, you can drop the flag entirely, or use--platform=$BUILDPLATFORMif you intend to cross-compile from the build host for speed.♻️ Suggested fix
-FROM --platform=$TARGETOS/$TARGETARCH rust:1.93-bookworm +FROM rust:1.93-bookworm🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docker/pterodactyl/rust/1.93/Dockerfile` at line 1, Remove the redundant platform override from the Dockerfile's FROM instruction: drop the `--platform=$TARGETOS/$TARGETARCH` from the `FROM --platform=$TARGETOS/$TARGETARCH rust:1.93-bookworm` line (or if you actually intend cross-compilation from the build host, change it to `--platform=$BUILDPLATFORM`); update the `FROM` directive accordingly so buildx can resolve the correct target platform automatically..github/workflows/pterodactyl-rust-yolks.yml (2)
51-53:latestis re-tagged on every matrix entry.Fine today with a single matrix row, but once a second Rust version is added, both jobs will race to push
latestand the winner is non-deterministic. Restrictlatestto a single designated "current" version, e.g. gate it on the matrix entry:♻️ Suggested refactor
matrix: include: - version: "1.93" dockerfile: docker/pterodactyl/rust/1.93/Dockerfile tag: "1.93" + latest: truetags: | type=raw,value=${{ matrix.tag }} - type=raw,value=latest + type=raw,value=latest,enable=${{ matrix.latest == true }}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/pterodactyl-rust-yolks.yml around lines 51 - 53, The workflow currently re-tags every matrix entry as "latest" (see the tags block and matrix.tag), causing race conditions; change the tags list so "latest" is emitted only for a designated current entry by adding a matrix field (e.g., matrix.current) and conditionally including the latest tag with an expression that checks matrix.tag == matrix.current (so the tags list contains type=raw,value=${{ matrix.tag }} plus type=raw,value=${{ matrix.tag == matrix.current && 'latest' }}), ensuring only the single designated job pushes the "latest" tag.
55-65: Consider provenance/SBOM defaults and pushing by digest for multi-arch.Optional hardening:
docker/build-push-action@v6emits provenance and SBOM attestations by default, which some registries/consumers don't want on atype=rawtag. If you want reproducible, attested images, either pinprovenance: mode=max+sbom: trueexplicitly, or disable (provenance: false) to keep the manifest list clean. Not a blocker, just a conscious choice to make.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/pterodactyl-rust-yolks.yml around lines 55 - 65, The build step using docker/build-push-action@v6 should explicitly set provenance/sbom behavior to avoid unwanted attestations on the multi-arch manifest: update the build step (the action block using docker/build-push-action@v6) to include either provenance: mode=max and sbom: true if you want attestations, or provenance: false to disable them; also ensure push: true remains set so the multi-arch manifest is published (and the action will emit the final digest), and keep tags: ${{ steps.meta.outputs.tags }} as-is.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/pterodactyl-rust-yolks.yml:
- Around line 36-37: The workflow is missing QEMU registration so the
linux/arm64 build will fail on the amd64 runner; add a step that uses
docker/setup-qemu-action (before the existing docker/setup-buildx-action step)
to register binfmt emulators so the multi-platform build (linux/arm64) can run
on ubuntu-latest (amd64) without exec format errors when running apt-get or
other binaries in the arm64 stage.
In `@docker/pterodactyl/rust/1.93/Dockerfile`:
- Around line 25-29: You changed CARGO_HOME to /home/container/.cargo but didn’t
update PATH, so binaries installed with cargo won’t be found; update the
Dockerfile ENV settings to prepend $CARGO_HOME/bin to PATH (e.g., set PATH to
include $CARGO_HOME/bin:$PATH after setting CARGO_HOME) so tools installed by
cargo install are resolvable at runtime; modify the ENV block that sets USER,
HOME, CARGO_HOME, CC, CXX to also export PATH with $CARGO_HOME/bin referenced.
---
Nitpick comments:
In @.github/workflows/pterodactyl-rust-yolks.yml:
- Around line 51-53: The workflow currently re-tags every matrix entry as
"latest" (see the tags block and matrix.tag), causing race conditions; change
the tags list so "latest" is emitted only for a designated current entry by
adding a matrix field (e.g., matrix.current) and conditionally including the
latest tag with an expression that checks matrix.tag == matrix.current (so the
tags list contains type=raw,value=${{ matrix.tag }} plus type=raw,value=${{
matrix.tag == matrix.current && 'latest' }}), ensuring only the single
designated job pushes the "latest" tag.
- Around line 55-65: The build step using docker/build-push-action@v6 should
explicitly set provenance/sbom behavior to avoid unwanted attestations on the
multi-arch manifest: update the build step (the action block using
docker/build-push-action@v6) to include either provenance: mode=max and sbom:
true if you want attestations, or provenance: false to disable them; also ensure
push: true remains set so the multi-arch manifest is published (and the action
will emit the final digest), and keep tags: ${{ steps.meta.outputs.tags }}
as-is.
In `@docker/pterodactyl/rust/1.93/Dockerfile`:
- Line 1: Remove the redundant platform override from the Dockerfile's FROM
instruction: drop the `--platform=$TARGETOS/$TARGETARCH` from the `FROM
--platform=$TARGETOS/$TARGETARCH rust:1.93-bookworm` line (or if you actually
intend cross-compilation from the build host, change it to
`--platform=$BUILDPLATFORM`); update the `FROM` directive accordingly so buildx
can resolve the correct target platform automatically.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b6f9884d-2f0b-4f4c-baed-d44714c51493
📒 Files selected for processing (3)
.github/workflows/pterodactyl-rust-yolks.ymldocker/pterodactyl/rust/1.93/Dockerfiledocker/pterodactyl/rust/entrypoint.sh
🦀 Rustalink Pull Request
Description
Add Pterodactyl Rust Docker image and workflow
Type of Change
Checklist
cargo fmtcargo clippyThank you for contributing to Rustalink! 🦀
Summary by CodeRabbit
New Features
Chores