When the persistent path is not writable (read-only or root-owned bind
mounts), S3Service's constructor failed lazily and every S3 request
surfaced as an opaque plain-text 500 that REST-XML SDK parsers cannot
read.
- validate the persistent path at boot and refuse to start with an
actionable error when any enabled service uses non-memory storage
- add class-scoped exception mappers so unhandled failures on S3 and
S3-Control routes render the S3 InternalError XML contract instead of
Quarkus's plain-text error page
- warn loudly from the container entrypoint when the state dir is not
writable by the runtime user
Fixes#1664
- 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
The published images run as USER 1001 with primary group root. On Docker
Desktop (macOS/Windows) /var/run/docker.sock is owned root:root inside
containers so the floci process can open it via the group-0 bit, but on
native Linux Docker (and Rootless/Podman) the socket is owned by
root:<docker-group> with mode 660 — and the floci user is not a member
of that group. This silently breaks ECR, Lambda, and RDS service
emulation on those hosts: floci's docker-java client gets BindException
/ SocketException and reports CREATE_FAILED on AWS::ECR::Repository.
Fix: ship a docker/entrypoint.sh modeled on the docker-library/postgres
pattern. It starts as root, stats the bind-mounted socket to learn the
host's docker GID, ensures a group with that GID exists, adds the floci
user to it, then `exec gosu floci` re-execs the same script as uid 1001
with the supplementary group set. The 'if id -u == 0' guard means
downstream `user:` overrides in compose files keep working unchanged.
Verified end-to-end on native Linux (Pop!_OS, docker GID 999) using a
minimal CDK bootstrap repro: AWS::ECR::Repository goes from CREATE_FAILED
to CREATE_COMPLETE and the registry:2 sidecar comes up cleanly. pid 1
runs as Uid:1001 Gid:0 Groups:999.
Implementation notes:
- All three Dockerfiles keep their original base images
(quarkus-micro-image, ubi9-minimal, eclipse-temurin alpine).
- Dockerfile.native gains a tools builder stage that uses the canonical
Red Hat pattern (`dnf install --installroot`) to install shadow-utils
into a stagable /toolsroot, which the runtime stage wholesale-copies
into quarkus-micro-image. Image growth: ~42 MB (quarkus-micro has no
package manager and lacks groupadd/usermod by itself).
- Dockerfile.native-package adds shadow-utils via microdnf (already had
the package manager).
- Dockerfile.jvm-package adds shadow + ca-certificates via apk so the
entrypoint can use the same useradd/groupadd/usermod syntax across
all three image variants.
- gosu 1.17 is downloaded and SHA256-pinned (rather than GPG-verified
as Postgres does) to avoid pulling gnupg2 into the runtime layers
and to sidestep a gpgme dependency conflict in ubi9-minimal.