Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# SPDX-FileCopyrightText: 2026 Dipl.Phys. Peer Stritzinger GmbH
# SPDX-License-Identifier: Apache-2.0
FROM ubuntu:22.04

#--- ENV -----------------------------------------------------------------------

ENV WORKDIR=/calzone
ENV LAUNCHER_SRC=$WORKDIR/launcher
ENV BAKER_SRC=$WORKDIR/baker

#--- Install requirements ------------------------------------------------------

RUN BASIC="git cmake ca-certificates" && \
BUILD="autoconf automake libtool build-essential" && \
MUSL="musl-dev musl-tools" && \
apt-get update && \
apt-get install -y --no-install-recommends \
$BASIC $BUILD $MUSL && \
rm -rf /var/lib/apt/lists/*

#--- Copy source ---------------------------------------------------------------
WORKDIR $WORKDIR

COPY . $WORKDIR

#--- Install libcbor -----------------------------------------------------------
WORKDIR $WORKDIR/libcbor
RUN git clone https://github.com/PJK/libcbor.git .

RUN CC=musl-gcc cmake -B _build \
-DCMAKE_C_COMPILER_AR=/usr/bin/ar \
-DCMAKE_C_COMPILER_RANLIB=/usr/bin/ranlib \
-DBUILD_SHARED_LIBS=OFF \
-DWITH_TESTS=OFF && \
cmake --build _build -j$(nproc)

#--- Install libarchive --------------------------------------------------------
WORKDIR $WORKDIR/libarchive
RUN git clone https://github.com/libarchive/libarchive.git .

RUN CC=musl-gcc cmake -B _build \
-DCMAKE_C_COMPILER_AR=/usr/bin/ar \
-DCMAKE_C_COMPILER_RANLIB=/usr/bin/ranlib \
-DENABLE_TEST=OFF \
-DENABLE_OPENSSL=OFF \
-DENABLE_ZLIB=OFF \
-DENABLE_BZip2=OFF \
-DENABLE_LZMA=OFF \
-DENABLE_ZSTD=OFF \
-DENABLE_LZ4=OFF \
-DENABLE_EXPAT=OFF \
-DENABLE_ICONV=OFF \
-DPOSIX_REGEX_LIB=NONE \
-DENABLE_LIBB2=OFF \
-DENABLE_LIBXML2=OFF && \
cmake --build _build -j$(nproc)

#--- Build -----------------------------------------------------------------
WORKDIR $WORKDIR

RUN ./autogen.sh && \
./configure && \
make && \
make check

CMD ["/bin/bash"]
65 changes: 52 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,26 @@ Both are built as part of the **calzone** project.
## Table of Contents

- [calzone](#calzone)
- [Build Instructions](#build-instructions)
- [Prerequisites](#prerequisites)
- [Static vs Dynamic Builds](#static-vs-dynamic-builds)
- [Bootstrap, Configure, Build](#bootstrap-configure-build)
- [Build Troubleshooting](#build-troubleshooting)
- [Cleaning Up](#cleaning-up)
- [Getting Calzone](#getting-calzone)
- [Build From Source](#build-from-source)
- [Prerequisites](#prerequisites)
- [Static vs Dynamic Builds](#static-vs-dynamic-builds)
- [Bootstrap, Configure, Build](#bootstrap-configure-build)
- [Build Troubleshooting](#build-troubleshooting)
- [Cleaning Up](#cleaning-up)
- [Use the Dockerfile](#use-the-dockerfile)
- [Download Prebuilt Binaries](#download-prebuilt-binaries)
- [Quickstart: build a sample self-extracting binary](#quickstart-build-a-sample-self-extracting-binary)
- [Interpreter patching with PATCHELF_SET_INTERPRETER](#interpreter-patching-with-patchelf_set_interpreter)

<a name="build-instructions"></a>
## Build Instructions
<a name="getting-calzone"></a>
## Getting Calzone

<a name="build-from-source"></a>
### Build From Source

<a name="prerequisites"></a>
### Prerequisites
##### Prerequisites

- POSIX shell (`/bin/sh`)
- GNU Autotools toolchain:
Expand Down Expand Up @@ -55,7 +61,7 @@ sudo apt install musl-dev musl-tools
```

<a name="static-vs-dynamic-builds"></a>
### Static vs Dynamic Builds
##### Static vs Dynamic Builds

By default, `configure` attempts to produce **fully static binaries** that are
self-contained and do not depend on system shared libraries. This makes the
Expand Down Expand Up @@ -203,7 +209,7 @@ make
This produces binaries that depend on system shared libraries at runtime.

<a name="bootstrap-configure-build"></a>
### Bootstrap, Configure, Build
##### Bootstrap, Configure, Build

From the repository root:

Expand Down Expand Up @@ -269,7 +275,7 @@ From the repository root:
Use `DESTDIR` or `--prefix` to control the installation target.

<a name="build-troubleshooting"></a>
### Build Troubleshooting
##### Build Troubleshooting

#### "libcbor headers not found"

Expand Down Expand Up @@ -340,13 +346,46 @@ sudo apt install musl-dev musl-tools
```

<a name="cleaning-up"></a>
### Cleaning Up
##### Cleaning Up

- `make clean` removes build artifacts from the source tree.
- `make distclean` additionally removes files generated by `configure`.
- `git clean -xfd` resets the tree completely (use with care; this deletes
untracked files).

<a name="docker-build"></a>
### Use the Dockerfile

The repository includes a `Dockerfile` that installs the required build tools,
builds local copies of `libcbor` and `libarchive`, and then runs the project
build inside the container.

Build the image from the repository root:

```sh
docker build -t calzone:local .
```

Start an interactive shell in the built image:

```sh
docker run --rm -it calzone:local /bin/bash
```

Inside the container you can find the binaries under `/calzone/baker/baker` and `/calzone/launcher/launcher`

<a name="download-prebuilt-binaries"></a>
### Download Prebuilt Binaries

Prebuilt Linux binaries are attached to GitHub releases for:

- `launcher-linux-amd64`
- `launcher-linux-arm64`
- `baker-linux-amd64`
- `baker-linux-arm64`

Each release asset also includes a matching `.sha256` checksum file.

<a name="quickstart-build-a-sample-self-extracting-binary"></a>
## Quickstart: build a sample self-extracting binary

Expand Down
Loading