/builder

An advanced build system based on Buildkit in order to generate compact Docker images with MetaCall runtime.

Primary LanguageGoApache License 2.0Apache-2.0

MetaCall Builder

Advanced builder based on Buildkit for selectively build compact Docker images selecting the only required languages.

Build

go build cmd/main.go

Run

./main py node rb | buildctl build --output type=docker,name=imagename | docker load

Run with buildctl-daemonless

Requirements:

MacOs:

For MacOs, you can use install buildkit using brew and lima for rootless containers, and run the script after the installation.

$ brew install buildkit
$ brew install lima
./main py node rb | ./hack/buildctl.sh build --output type=docker,name=imagename | docker load

Run with docker

Use the environment variable BUILDER_ARGS for passing the arguments.

With daemon:

BUILDER_ARGS="runtime py" docker compose up --exit-code-from client client

Rootless:

BUILDER_ARGS="runtime node" docker compose up --exit-code-from rootless rootless

You can also run the builder binary only:

BUILDER_ARGS="runtime rb" docker compose up --exit-code-from binary binary

Linter

docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.59.1 golangci-lint run -v --enable-all

Useful Tools

Dive can be used to analyze each layer of the generated image

dive <your-image-tag>

This opens up a window where in we can see changes in each layer of the image according to preferences.

Ctrl + L : To show only layer changes

Tab : To switch view from layers to current layer contents