intel-device-plugins-for-ku.../build/docker/lib/toybox_build.docker
Mikko Ylinen e02c480ab7 images: use buildkit again
The Toybox images had two issues:

1. Distroless does not support /bin -> /usr/bin so we needed to
create it manually to get /bin/bash for Toybox. However, with this
Openshift image validation complains that we are touching the "base"
image.

2. We could not use buildkit since it fails with /bin symlink
copied over /bin directory from Distroless.

The simple fix is just to move away from all /bin/sh and /bin/bash
and use "/usr/bin/env bash" to resolve the path instead. This allows
to keep /bin untouched.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2023-12-08 08:01:22 +02:00

18 lines
893 B
Docker

ARG TOYBOX_VERSION="0.8.10"
ARG TOYBOX_SHA256="3c31e235fe87e74e6c6cf7cd7299fcbffb0f4a4834dae607aa26bb4f1583549a"
ARG ROOT=/install_root
RUN apt-get update && apt-get --no-install-recommends -y install musl musl-tools musl-dev
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
RUN curl -SL https://github.com/landley/toybox/archive/refs/tags/$TOYBOX_VERSION.tar.gz -o toybox.tar.gz \N
&& echo "$TOYBOX_SHA256 toybox.tar.gz" | sha256sum -c - \N
&& tar -xzf toybox.tar.gz \N
&& rm toybox.tar.gz \N
&& cd toybox-$TOYBOX_VERSION \N
&& KCONFIG_CONFIG=${DIR}/build/docker/toybox-config-$(echo ${FINAL_BASE} | xargs basename -s :latest) LDFLAGS="--static" CC=musl-gcc PREFIX=$ROOT/usr/bin V=2 make toybox install_flat \N
&& install -D LICENSE $ROOT/licenses/toybox \N
&& cp -r /usr/share/doc/musl $ROOT/licenses/
###