Skip to content

Latest commit

 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

moonbit-docker

ghcr.io Build Build nightly Ask DeepWiki License

Unofficial MoonBit toolchain images for linux/amd64 and linux/arm64, with release and nightly tags.

This project is not affiliated with the MoonBit team. The images contain the upstream binaries as installed by the official install script; see License.

Usage

Run tests in the current directory:

podman run --rm -it -v "$PWD:/work:Z" ghcr.io/gaato/moonbit:latest moon test

Use :nightly to try the nightly toolchain, or a version tag such as :0.10 to stay on a release series.

Multi-stage builds

FROM ghcr.io/gaato/moonbit:0.10.14 AS build
COPY . .
RUN moon build --target native --release

FROM gcr.io/distroless/base-debian13
COPY --from=build /work/_build/native/release/build/cmd/main/main.exe /app
ENTRYPOINT ["/app"]

Adjust the executable path to match your project. Choose a builder base compatible with your runtime: native binaries need a compatible glibc and any other shared libraries they link against. For example, use a -bookworm builder for a Debian 12 runtime.

GitHub Actions

jobs:
  test:
    runs-on: ubuntu-24.04
    container: ghcr.io/gaato/moonbit:0.10
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
      - run: moon test

Bases

Tags without a suffix use Debian trixie and point to the same images as -trixie tags. Use -bookworm to choose Debian 12, for example 0.10-bookworm.

Tag suffix Base image
none or -trixie node:24-trixie-slim
-bookworm node:24-bookworm-slim

The bases are the Debian variants of the official Node.js images, so the Debian release still determines the glibc the native backend links against. Node is there because the js backend shells out to it: moon run and moon test need it on that target.

The images contain the upstream MoonBit toolchain in /opt/moon, plus node, npm, git, curl, gcc, and libc development headers. The toolchain directory is writable by any UID, allowing use with --user or --userns=keep-id.

The Node major is fixed at build time and is not updated within a published release tag, the same as the rest of the base.

Tags

Tag Meaning
latest Latest published upstream release for the base
nightly Upstream nightly, rebuilt daily
nightly-YYYYMMDD First successful nightly publication on that UTC date
0.10 Latest published patch release in the 0.10.x series
0.10.14 Release version without the build hash
0.10.14-7d59c7ec9 Exact upstream version 0.10.14+7d59c7ec9

Minor tags stay within their series: 0.10 does not move to 0.11. Dated nightly tags are preserved after publication. Use an image digest to pin an exact image.

Updates

Each base is published once both linux/amd64 and linux/arm64 pass smoke tests. Bases publish independently, so a failed build can leave one base on an older version. See versions.json for published releases by base.

Daily workflows check for new releases and rebuild nightly images. Release images do not receive automatic base image updates. Older releases and dated nightlies are not backfilled when a base is added.

Maintenance

The Build workflow accepts an upstream version such as 0.10.14+7d59c7ec9 and a base from bases.json, or all (the default). Specifying a version forces a rebuild; leaving it empty builds the current release for bases that have not published it yet. The nightly workflow also accepts base.

Run the publication tests locally:

prove scripts/*.t

License

The build scripts in this repository are under the Blue Oak Model License 1.0.0. That license does not cover MoonBit itself. Upstream publishes the sources of moon and core under Apache-2.0, and of the compiler under the MoonBit Public Source License.

About

Unofficial MoonBit toolchain container images, tracking upstream releases

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

Contributors

Languages