I will check out Docker which looks interesting, but right now I'm trying to get free of the magic (that has served me very well for a long time, I should add!)
I've just created a minimal example based on the
Build Lazarus from Source wiki information and the
Makefile to create a Docker container based on latest official FPC release.
# syntax=docker/dockerfile:1
##
## Configuration
##
# set Ubuntu release version (latest, focal, bionic, ...)
ARG UBUNTU_VERSION=focal
# set FPC version (format: d.d.d)
ARG FPC_VERSION=3.2.2
##
## Compile lazbuild of Lazarus 2.2.6
##
FROM freepascal/fpc:${FPC_VERSION}-${UBUNTU_VERSION}-full
WORKDIR /tmp
# docker buildx variables
ARG TARGETPLATFORM
ARG BUILDPLATFORM
# install git, clone sourcecode, compile lazbuild
RUN set -eux \
&& apt-get update \
&& apt-get install -y git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& echo "Installing Lazarus for ${TARGETPLATFORM} on ${BUILDPLATFORM}." \
# get sources from git repository
&& git clone --depth 1 --branch lazarus_2_2_6 https://gitlab.com/freepascal.org/lazarus/lazarus.git \
&& cd lazarus* \
# compile
#&& make bigide # requires more packages and a full widgetset
&& make lazbuild
I'm not sure what you can build with it and if it's really useful as I only used Lazarus on a full desktop environment so far. Thus someone with more experience in that should help if we want to get a fully working Docker image