Add official Docker image for the P toolchain#983
Open
crowecawcaw wants to merge 1 commit into
Open
Conversation
crowecawcaw
force-pushed
the
docker-image
branch
from
July 16, 2026 22:08
2810af9 to
f722cd5
Compare
crowecawcaw
marked this pull request as ready for review
July 16, 2026 22:09
Bundles the .NET SDK 8.0, JDK 17, Maven, graphviz, and the p CLI (built from this repository's source) so P can be compiled and checked without a manual toolchain setup -- handy for CI and for trying P out. - Dockerfile: multi-stage build. Stage 1 packs the p CLI from source; stage 2 is the toolchain image. JDK 17 matches Src/PEx/pom.xml's target, and JAVA_HOME is resolved via a stable symlink so it is correct on both amd64 and arm64. - .dockerignore keeps the build context small. - docker-image.yml: PR CI, path-filtered to Docker changes. Builds natively on amd64 and arm64, smoke-tests p compile / p check inside the container, and runs a report-only Trivy scan. - docker-publish.yml: on a published GitHub Release, builds per-arch, pushes by digest, and assembles a multi-arch manifest to ghcr.io/p-org/p tagged with the release version and latest. - dependabot.yml keeps the base image and GitHub Actions up to date. - Docs: Docker section in the install guide (referenced from the quick start), plus a README badge and run snippet. Closes p-org#980. Signed-off-by: Stephen Crowe <6042774+crowecawcaw@users.noreply.github.com>
crowecawcaw
force-pushed
the
docker-image
branch
from
July 16, 2026 23:02
f722cd5 to
5e8dd50
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #980.
Adds an official Docker image for the P toolchain so P can be compiled and checked without installing the .NET SDK, Java, Maven, and graphviz by hand — especially handy for CI and for trying P out.
What's included
Dockerfile— multi-stage build.pCLI from this repository's source (dotnet pack), so the image always matches the committed/released code (no dependency on the NuGet package already being published).ptool installed from the locally-built package.Src/PEx/pom.xmltargets Java 17, so the PEx/PSym backends need a JVM that can run Java-17 bytecode.JAVA_HOMEis resolved via a stable symlink so it's correct on both amd64 and arm64 (the Debian JDK path is arch-specific)..dockerignore— keeps the build context small (excludes.git, build drops, docs, etc.)..github/workflows/docker-image.yml— PR CI. Path-filtered so it only runs when theDockerfile,.dockerignore, or the workflow itself changes (plus manual dispatch) rather than on every push. Builds natively on amd64 (ubuntu-latest) and arm64 (ubuntu-24.04-arm), smoke-testsp compile+p checkon a tutorial inside the container, and runs a Trivy vulnerability scan (report-only)..github/workflows/docker-publish.yml— on a published GitHub Release, builds per-arch natively, pushes each by digest, and assembles a multi-arch manifest toghcr.io/p-org/ptagged with the release version +latest..github/dependabot.yml— keeps the base image and the GitHub Actions used here up to date.Usage
Testing done
Built and ran locally on arm64:
docker buildsucceeds.p compile+p check -tc tcSingleClient -i 200runs the Java PEx backend end-to-end (200 schedules explored, 0 bugs, coverage report written); JDK 17, Maven, graphviz, andJAVA_HOMEall verified in both login and non-login shells.CI in this PR exercises the build + smoke test on both amd64 and arm64.
Note on availability
The image is only published when a GitHub Release is created, and a repo's first GHCR package is created private. So before anyone can
docker pull ghcr.io/p-org/p, a maintainer will need to:ghcr.io/p-org/ppackage to public (optionally linking it to the repo).No code change needed for that — it's a one-time settings step around the first release.
Choices made (happy to change)
p-<version>), pluslatest. Releases cut without that tag format would only getlatest.exit-code: 0) so new upstream CVEs don't block PRs. Can be made blocking (keepingignore-unfixed: true) if preferred.