Files
cfg/Containerfile
Dustin C. Hatch 11f9957c11 Switch from KCL to CUE
Although KCL is unquestionably a more powerful language, and maps more
closely to my mental model of how host/environment/application
configuration is defined, the fact that it doesn't work on ARM (issue
982]) makes it a non-starter.  It's also quite slow (owing to how it
compiles a program to evaluate the code) and cumbersome to distribute.
Fortunately, `tmpl` doesn't care how the values it uses were computed,
so we freely change configuration languages, so long as whatever we use
generates JSON/YAML.

CUE is probably a lot more popular than KCL, and is quite a bit simpler.
It's more restrictive (values cannot be overridden once defined), but
still expressive enough for what I am trying to do (so far).
2024-01-15 11:40:58 -06:00

48 lines
1.1 KiB
Docker

FROM registry.fedoraproject.org/fedora-minimal:39 AS build
ARG CUE_VERSION=0.7.0
RUN --mount=type=cache,target=/var/cache \
microdnf install -y \
--setopt install_weak_deps=0 \
gzip \
tar \
&& ARCH=$(uname -m) \
&& case "${ARCH}" in \
x86_64) ARCH=amd64 ;; \
aarch64) ARCH=arm64 ;; \
esac \
&& url="https://github.com/cue-lang/cue/releases/download/v${CUE_VERSION}/cue_v${CUE_VERSION}_linux_${ARCH}.tar.gz" \
&& curl -fsSL "${url}" \
| tar -C /usr/local/bin -xz cue \
&& :
FROM git.pyrocufflink.net/containerimages/tmpl
RUN --mount=type=cache,target=/var/cache \
--mount=type=bind,from=build,source=/,target=/build \
microdnf install -y \
--setopt install_weak_deps=0 \
age \
git-core \
&& ln -snf /host/etc/passwd /etc/passwd \
&& ln -snf /host/etc/group /etc/group \
&& cp -a /build/usr/local/bin/cue /usr/local/bin/ \
&& for cmd in \
systemctl \
systemd-sysusers \
; do ln -s nsenter.sh /usr/local/bin/${cmd}; done \
&& :
COPY nsenter.sh /usr/local/bin/nsenter.sh
COPY config.sh /
ENTRYPOINT []
CMD ["/config.sh"]
LABEL license= \
vendor='Dustin C. Hatch' \