Files
floci/docker/Dockerfile.native-package
T
Hector Ventura 023880b7d9 feat(parity): LocalStack drop-in compatibility (#696)
- Translate LocalStack env vars (LOCALSTACK_HOST, PERSISTENCE, LAMBDA_DOCKER_NETWORK, etc.)
  to Floci equivalents automatically at startup; opt out with LOCALSTACK_PARITY=false
- Serve /_localstack/init and /_localstack/health alongside /_floci/* equivalents
- Report executed scripts with path, state, and return_code in /_floci/init response
- Add /_aws/sqs/messages GET (non-destructive peek) and DELETE (purge) inspection endpoint
- Add /_aws/execute-api/{apiId}/{stageName} LocalStack-compat path for REST API invocation
- Add four-phase init hook lifecycle (boot/start/ready/stop) with dual-path discovery
  (/etc/floci/init/ and /etc/localstack/init/ compat paths)
- Install Python 3, AWS CLI, boto3 in standard image; wrap aws binary to pre-configure
  --endpoint-url=http://localhost:4566 so init scripts need no extra flags
- Wire entrypoint.sh + gosu privilege drop into all Dockerfile variants
- Add migration guide and update README, docker-compose, docker-images, SQS, and
  initialization-hooks docs
2026-05-04 01:15:59 -05:00

50 lines
1.7 KiB
Docker

FROM registry.access.redhat.com/ubi9-minimal:9.7
ARG VERSION=latest
# Automatically set by Docker BuildKit to "amd64" or "arm64"
ARG TARGETARCH
ENV FLOCI_VERSION=${VERSION}
ENV FLOCI_STORAGE_PERSISTENT_PATH=/app/data
ENV GOSU_VERSION=1.17
ENV GOSU_AMD64_SHA256=bbc4136d03ab138b1ad66fa4fc051bafc6cc7ffae632b069a53657279a450de3
ENV GOSU_ARM64_SHA256=c3805a85d17f4454c23d7059bcb97e1ec1af272b90126e79ed002342de08389b
RUN set -eux; \
microdnf install -y --nodocs shadow-utils; \
microdnf clean all; \
useradd -r -u 1001 -g root -d /app -s /sbin/nologin floci; \
arch="$(uname -m)"; \
case "$arch" in \
x86_64) gosuArch='amd64'; gosuSha256="$GOSU_AMD64_SHA256" ;; \
aarch64) gosuArch='arm64'; gosuSha256="$GOSU_ARM64_SHA256" ;; \
*) echo >&2 "unsupported arch: $arch"; exit 1 ;; \
esac; \
curl -fsSL -o /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-${gosuArch}"; \
echo "${gosuSha256} /usr/local/bin/gosu" | sha256sum -c -; \
chmod +x /usr/local/bin/gosu; \
gosu --version; \
gosu nobody true
WORKDIR /app
RUN mkdir -p /app/data \
&& chown -R 1001:root /app \
&& chmod -R g+rwX /app
VOLUME /app/data
COPY --chown=1001:root native/${TARGETARCH}/ /app/
RUN mv /app/*-runner /app/application && chmod +x /app/application
COPY --chmod=755 docker/entrypoint.sh /usr/local/bin/docker-entrypoint.sh
COPY --chmod=755 docker/localstack-parity.sh /usr/local/bin/localstack-parity.sh
EXPOSE 4566
HEALTHCHECK --interval=5s --timeout=3s --retries=5 \
CMD curl -f http://localhost:4566/_floci/health || exit 1
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["/app/application", "-Dquarkus.http.host=0.0.0.0"]