Files
floci/docker/Dockerfile.native-package
T
TATSUNO “Taz” Yasuhiro 64f06e090f perf(docker): shrink image by 28% using ubi9-micro (109 MB to 78 MB compressed) (#3085)
* perf(docker): move the native image to ubi9-micro

The binary needs only libc, and since #3037 the entrypoint needs only
bash and coreutils. ubi9-micro has both at 7 MB compressed instead of
ubi9-minimal's 40 MB. Measured on arm64 with the nightly-09042026
binary: 109 MB to about 78 MB compressed, 313 MB to 229 MB uncompressed.

ubi9-micro has no useradd and no curl, so the user is one /etc/passwd
line and the healthcheck is a bash /dev/tcp probe. Dockerfile.native
gets the same runtime stage and loses its unused gosu tools stage.
Dockerfile.compat needs microdnf, so it now starts from ubi9-minimal
and copies /app out of the native image.

* chore(docker): share the health probe and split the compat tools stage

The bash health probe is now docker/healthcheck.sh, used by all three
Dockerfiles. Dockerfile.compat gets a version independent tools stage;
the aws CLI shim test and the cache warm job build target: tools, so
they pull no floci image and their cached layers stay stable. ARG
VERSION and the native RUN steps move so only the binary copy changes
between builds.

* fix(docker): copy healthcheck.sh into the compat image from the build context

* ci(compat): build the whole compat image on pull requests and check it starts healthy
2026-09-05 14:46:41 -05:00

48 lines
1.8 KiB
Docker

FROM registry.access.redhat.com/ubi9-micro:9.7
# Automatically set by Docker BuildKit to "amd64" or "arm64"
ARG TARGETARCH
WORKDIR /app
# ubi9-micro has no shadow-utils, so the runtime user is one /etc/passwd line.
RUN echo 'floci:x:1001:0:Floci:/app:/sbin/nologin' >> /etc/passwd \
&& mkdir -p /app/data \
&& chown -R 1001:root /app \
&& chmod -R g+rwX /app
VOLUME /app/data
COPY --chmod=755 docker/entrypoint.sh /usr/local/bin/docker-entrypoint.sh
COPY --chmod=755 docker/localstack-parity.sh docker/healthcheck.sh /usr/local/bin/
ARG VERSION=latest
ENV FLOCI_VERSION=${VERSION}
ENV FLOCI_STORAGE_PERSISTENT_PATH=/app/data
COPY --chmod=755 --chown=1001:root native/${TARGETARCH}/ /app/
LABEL org.opencontainers.image.title="Floci" \
org.opencontainers.image.description="Local AWS emulator — open-source alternative to LocalStack Community" \
org.opencontainers.image.url="https://floci.io" \
org.opencontainers.image.source="https://github.com/floci-io/floci" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.vendor="Floci" \
description="Local AWS emulator — open-source alternative to LocalStack Community" \
io.k8s.description="Local AWS emulator — open-source alternative to LocalStack Community" \
io.k8s.display-name="Floci" \
io.openshift.expose-services="4566:tcp" \
io.openshift.tags="floci aws-emulator" \
maintainer="Floci <https://github.com/floci-io/floci>" \
name="floci/floci" \
summary="Local AWS emulator — open-source alternative to LocalStack Community" \
url="https://floci.io" \
vendor="Floci"
EXPOSE 4566
HEALTHCHECK --interval=5s --timeout=3s --retries=5 CMD ["/usr/local/bin/healthcheck.sh"]
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["/app/application", "-Dquarkus.http.host=0.0.0.0"]