Skip to content

feat: replace dfx-based images with icp-cli Motoko, Rust, and All images#31

Merged
marc0olo merged 14 commits into
mainfrom
feat/icp-cli-images
May 30, 2026
Merged

feat: replace dfx-based images with icp-cli Motoko, Rust, and All images#31
marc0olo merged 14 commits into
mainfrom
feat/icp-cli-images

Conversation

@marc0olo

@marc0olo marc0olo commented May 29, 2026

Copy link
Copy Markdown
Member

Summary

This PR replaces the legacy dfx-based icp-dev-env-slim image with three new icp-cli-based images purpose-built for Codespaces and CI:

  • icp-dev-env-motoko — Motoko development environment (debian:bookworm-slim base) with icp-cli, ic-wasm, and mops; moc installed per-project via mops install
  • icp-dev-env-rust — Rust development environment (rust:1.95.0-slim-bookworm base) with icp-cli, ic-wasm, and the wasm32-unknown-unknown target
  • icp-dev-env-all — Combined Motoko + Rust environment for mixed-language projects

All three images are built for linux/amd64 and linux/arm64.

Key changes

  • Removed all legacy dfx-based image jobs (build-and-push-image, build-and-push-image-azle, build-and-push-image-slim)
  • Added three new CI jobs — one per image variant
  • Pinned all tool versions via ARG in Dockerfiles (icp-cli 0.2.7, ic-wasm 0.9.11, ic-mops 2.13.2, Node.js 24.15.0, Rust 1.95.0)
  • moc (Motoko compiler) is intentionally not baked into the image — each project installs its own version via mops install, allowing per-project compiler selection
  • CI only publishes on workflow_dispatch or a GitHub Release (non-draft) — no auto-publish on branch push
  • Updated CODEOWNERS to @dfinity/dx
  • Fixed README: removed non-existent :latest tag references, added icp-dev-env-all section, corrected Releasing instructions

Publishing

Images are published to GHCR when a GitHub Release is created. Create a release tagged v1.0.0 (semver, clean break from the old integer scheme) to trigger:

  • ghcr.io/dfinity/icp-dev-env-motoko:1.0.0
  • ghcr.io/dfinity/icp-dev-env-rust:1.0.0
  • ghcr.io/dfinity/icp-dev-env-all:1.0.0

The release must be published as non-draft to trigger the CI pipeline.

Backward compatibility

The old icp-dev-env-slim:22 image is not deleted — it remains available on GHCR and all existing references to it (e.g. in dfinity/examples devcontainers and ninja_pr_checks.yml) continue to work unchanged.

🤖 Generated with Claude Code

marc0olo and others added 12 commits May 21, 2026 11:24
Adds two new language-specific Docker images replacing dfx with icp-cli:

- motoko/Dockerfile: icp-cli, ic-wasm, moc 1.5.1, mops, Node.js, pnpm
- rust/Dockerfile: icp-cli, ic-wasm, Rust toolchain, wasm32 target, Node.js, pnpm

Updates CI to trigger on workflow_dispatch and pushes to feat/icp-cli-images
in addition to releases. New motoko and rust jobs publish multi-platform
(amd64 + arm64) images tagged :dev from this branch, semver from releases.

This is a pilot for advertising GitHub Codespaces instead of ICP Ninja /
short-lived mainnet deployments. See dfinity/examples#1345.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…jobs

- Pin all tool versions: icp-cli 0.2.7, ic-wasm 0.9.11, ic-mops 2.13.2, moc 1.8.1
- Switch base image from debian:bookworm-slim to ubuntu:24.04 (fewer unfixed CVEs)
- Drop libunwind-dev (not required by icp-cli, mops, or moc)
- Add apt-get upgrade to apply all available security patches at build time
- Install Rust via rustup instead of using the rust: base image
- Remove legacy base/slim/azle CI jobs from fork (dfx-based, irrelevant to pilot)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…okworm)

ubuntu:24.04 is larger than the slim variants and offers no meaningful CVE
reduction over debian:bookworm-slim after apt-get upgrade. Remaining CVEs
post-upgrade are unfixed upstream and present in any standard base image.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Removes the three dfx-based images that are no longer needed:
- Dockerfile (root): base image, amd64-only, dfx 0.27 + PocketIC Python
- slim/Dockerfile: slim multi-platform image, dfx 0.29 (referenced by examples)
- azle/Dockerfile: Azle (JS/TS) image, dfx 0.27

The repo now contains only the two new icp-cli-based images:
- motoko/Dockerfile
- rust/Dockerfile

Updates README to document the new images, their tool versions,
a devcontainer.json usage example, and the release process.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
mops install (run in postCreateCommand) handles the [toolchain] section
of each example's mops.toml and installs the correct moc version
automatically. Pre-installing moc in the image is not needed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rsions

- Node.js 22.10.0 → 24.15.0 in both Dockerfiles and README
- actions/checkout v4 → v6.0.2
- docker/login-action v3 → v4.1.0
- docker/metadata-action v5 → v6.0.0
- docker/setup-qemu-action v3 → v4.0.0
- docker/setup-buildx-action v3 → v4.0.0
- docker/build-push-action v6 → v7.1.0

All actions previously ran on Node.js 20 which is deprecated on GitHub
Actions runners from June 2026.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
icp-cli links against libdbus-1.so.3 at runtime; missing from
debian:bookworm-slim and rust:slim-bookworm base images.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds all/Dockerfile based on rust:slim-bookworm with mops layered on top.
Intended as the default devcontainer image when opening the examples repo
root — lets developers work across both Motoko and Rust examples without
switching environments.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CI workflows run `make test` after deploying — make was missing from
the apt packages in all three images.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ispatch

Publishing images to the dfinity org on every push to the branch is
unacceptable. Images should only be published on an explicit release
or manual dispatch. Also removes the :dev raw tag which was only
meaningful in the now-removed branch-push context.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@marc0olo marc0olo requested a review from a team as a code owner May 29, 2026 00:13
marc0olo and others added 2 commits May 29, 2026 02:26
- Replace :latest tag references with semver (1.0.0) — :latest is not
  produced by the CI workflow
- Add icp-dev-env-all image section (was missing entirely)
- Fix Releasing section: "both images" → "all images", list all three
  Dockerfiles, note release must be non-draft
- Update CODEOWNERS: replace @dfinity/ninja-devs @dfinity/sdk with
  @dfinity/dx

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add PNPM_VERSION=11.4.0 ARG to all three Dockerfiles; pnpm has no LTS
  channel so we pin to current stable like all other tools
- CI now publishes :latest alongside the semver tag on GitHub Release
- README: replace "pnpm latest" with pinned version in tool tables,
  show both :latest and pinned pull commands per image

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@marc0olo marc0olo merged commit d53cbb7 into main May 30, 2026
5 checks passed
@marc0olo marc0olo deleted the feat/icp-cli-images branch May 30, 2026 00:56
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