Skip to content

Add Pterodactyl Rust Docker image and workflow#54

Open
infnibor wants to merge 2 commits intobongodevs:masterfrom
infnibor:master
Open

Add Pterodactyl Rust Docker image and workflow#54
infnibor wants to merge 2 commits intobongodevs:masterfrom
infnibor:master

Conversation

@infnibor
Copy link
Copy Markdown

@infnibor infnibor commented Apr 18, 2026

🦀 Rustalink Pull Request

Description

Add Pterodactyl Rust Docker image and workflow

Type of Change

  • Bug fix
  • New feature
  • Performance improvement
  • Refactor
  • Cleanup
  • Documentation update

Checklist

  • Code compiles without warnings
  • Formatted with cargo fmt
  • Passed cargo clippy
  • Added/updated documentation
  • No breaking changes (or documented if there are)

Thank you for contributing to Rustalink! 🦀

Summary by CodeRabbit

  • New Features

    • Published Rust 1.93 runtime images for AMD64 and ARM64 with a non-root runtime user and sensible defaults (workdir, stop signal).
    • Container startup now exposes an INTERNAL_IP variable, prints Cargo version, and supports templated startup commands.
  • Chores

    • Added automated build-and-publish pipeline for multi-architecture Docker images.

Copilot AI review requested due to automatic review settings April 18, 2026 19:30
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 149a4ffe-1cef-465f-9aa0-d88a879bbbcc

📥 Commits

Reviewing files that changed from the base of the PR and between 69b7ce1 and e57d654.

📒 Files selected for processing (1)
  • .github/workflows/pterodactyl-rust-yolks.yml
✅ Files skipped from review due to trivial changes (1)
  • .github/workflows/pterodactyl-rust-yolks.yml

📝 Walkthrough

Walkthrough

Adds 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

Cohort / File(s) Summary
CI/CD Workflow
.github/workflows/pterodactyl-rust-yolks.yml
New GitHub Actions workflow (workflow_dispatch + push on master) that sets up QEMU/Buildx, logs into GHCR, generates metadata tags (1.93, latest), and builds/pushes multi-arch images (linux/amd64, linux/arm64) with GHA cache.
Docker Image & Entrypoint
docker/pterodactyl/rust/1.93/Dockerfile, docker/pterodactyl/rust/entrypoint.sh
New Dockerfile for Rust 1.93 (Bookworm): installs build/runtime dependencies, configures non-root container user, sets env vars and tini entrypoint; entrypoint script exports INTERNAL_IP, prints Cargo version, converts {{...}} to shell expansions in STARTUP, echoes and evals the resulting command.

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped through CI at break of dawn,

Built Rust 1.93 and carried it on,
Two arches packed in a tidy crate,
Pushed to the clouds — how splendid, great! 🚀

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is incomplete. It's missing key sections: Related Issue, Changes Made (detailed list), and Testing. The Type of Change selection is also questionable (marked as 'Bug fix' when this appears to be a 'New feature'). Add the Related Issue section, provide a detailed Changes Made list, describe testing approach, and correct the Type of Change to 'New feature'. Ensure all checklist items are properly addressed.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding a Pterodactyl Rust Docker image and associated GitHub Actions workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 tini as 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.

Comment thread docker/pterodactyl/rust/entrypoint.sh
Comment thread docker/pterodactyl/rust/entrypoint.sh
Comment thread .github/workflows/pterodactyl-rust-yolks.yml
Comment thread .github/workflows/pterodactyl-rust-yolks.yml
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (3)
docker/pterodactyl/rust/1.93/Dockerfile (1)

1-1: --platform=$TARGETOS/$TARGETARCH is redundant.

$TARGETOS/$TARGETARCH is equivalent to the already-default $TARGETPLATFORM that buildx uses for the target stage, and it drops the variant component (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 --platform is set, you can drop the flag entirely, or use --platform=$BUILDPLATFORM if 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: latest is 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 latest and the winner is non-deterministic. Restrict latest to 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: true
           tags: |
             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@v6 emits provenance and SBOM attestations by default, which some registries/consumers don't want on a type=raw tag. If you want reproducible, attested images, either pin provenance: mode=max + sbom: true explicitly, 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

📥 Commits

Reviewing files that changed from the base of the PR and between 74959c0 and 69b7ce1.

📒 Files selected for processing (3)
  • .github/workflows/pterodactyl-rust-yolks.yml
  • docker/pterodactyl/rust/1.93/Dockerfile
  • docker/pterodactyl/rust/entrypoint.sh

Comment thread .github/workflows/pterodactyl-rust-yolks.yml
Comment thread docker/pterodactyl/rust/1.93/Dockerfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants