Commit Graph
9 Commits
Author SHA1 Message Date
Hector Ventura 9dcb1b65ae feat(core): translate LocalStack variables in Java instead of the entrypoint (#5851)
* feat(core): translate LocalStack variables in Java instead of the entrypoint

The LocalStack-to-Floci variable mapping (PERSISTENCE, EDGE_PORT,
LOCALSTACK_HOST, GATEWAY_LISTEN, LS_LOG/DEBUG, the Lambda and Docker
variables, the DNS suffixes, USE_SSL, CUSTOM_SSL_CERT_PATH) lived in
docker/localstack-parity.sh, sourced by the image's entrypoint. A JVM run or
a native binary on the host never saw it.

LocalStackParity now computes the same mapping and LocalStackParityConfigSource
serves it at ordinal 301, just above environment variables, as the exported
variables did. A key is produced only when its Floci variable is unset, so an
explicit Floci setting still wins; the DNS suffixes are still appended to any
configured ones; LOCALSTACK_PARITY=false still turns it all off.
TlsConfigSource, which reads its properties before the configuration exists,
consults the mapping too.

The script, its shell test and every Dockerfile copy of it are removed; the
test cases move to LocalStackParityTest.

Refs #5767

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* fix(core): keep TLS backends on loopback, keep configured DNS suffixes, and pass LocalStack settings to hooks

Review follow-ups for the Java LocalStack translation:

- Dockerfile.compat took docker-entrypoint.sh from the published native
  image, which still sourced the removed localstack-parity.sh, so the compat
  image never became healthy. It now copies the entrypoint from the build
  context, as it already does healthcheck.sh.
- At ordinal 301 the parity source outranked TlsConfigSource's loopback pin
  (300): with TLS on and GATEWAY_LISTEN set, the backends bound the gateway
  address while the proxy dialled 127.0.0.1. It now sits at 299, below
  environment variables and the TLS source and above .env and
  config/application.yml, where the exported variables used to be.
- floci.dns.extra-suffixes is no longer a translated property, which on JVM
  and native runs replaced suffixes set in application.yml. The five
  readers append LocalStack's and Floci's suffixes to the configured list
  through LocalStackParity.withDnsSuffixes instead.
- GATEWAY_LISTEN=0.0.0.0:4566 (or [::]:4566, or a list) gives the host to
  quarkus.http.host and the port to floci.port when EDGE_PORT is unset,
  instead of a host Floci rejects as malformed.
- Init hooks get the translation as FLOCI_*/QUARKUS_* variables again, as
  they did when the entrypoint exported them.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* fix(core): parse LOCALSTACK_HOST and GATEWAY_LISTEN the way LocalStack does

Both take LocalStack's host-and-port forms (HostAndPort.parse in its
config.py): host:port, host, :port, [v6]:port and [v6].

- LOCALSTACK_HOST is <hostname>:<port>, localhost.localstack.cloud:4566 by
  default. Its port went into floci.hostname, so the base URL came out as
  http://localhost.localstack.cloud:4566:4566. floci.hostname now gets the
  host alone.
- GATEWAY_LISTEN=:4566, LocalStack's default host on 4566, did not match
  and stopped startup with "Refusing to listen on malformed host". An empty
  host now keeps Floci's own bind address and takes just the port.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-17 17:37:15 -04:00
TATSUNO “Taz” Yasuhiro cc129007e4 perf(docker): cut healthy wait from 5 s to 0.1 s (#5447)
* perf(docker): cut healthy wait from 5 s to 0.1 s

* fix(docker): wait up to 5 s for ready hooks before reporting healthy

* fix(docker): build without pulling a Dockerfile frontend from Docker Hub
2026-10-11 22:07:24 -05:00
Anders Wasen bd005ac9c7 fix(docker): stop the bundled AWS CLI fetching URL-valued parameters (#3426)
The image installs the AWS CLI with pip, which ships only v1, and v1 treats a parameter value
that looks like a URL as a pointer to fetch rather than as the value. awscli/paramfile.py reads
cli_follow_urlparam with a default of true, so an init hook in /etc/floci/init/ready.d putting
an SSM parameter such as MY_API_URL=https://example.com fails with "Unable to retrieve
https://example.com", and a hook that backgrounds its calls loses that silently.

AWS CLI v2 dropped the behaviour, so this never reproduces when the same script is run from a
host with v2 installed, only inside the image. Disabling the setting in the profile the image
bakes fixes it for every hook; setting it at runtime does not work, because aws configure set
writes to a root-owned file while hooks run after the entrypoint's privilege drop.

Mirrored into docker/Dockerfile.jvm-package, whose runtime stage is a copy of this one and is
pinned to it by DockerfileRuntimeParityTest.
2026-09-17 07:41:12 -05:00
Niels Kootstra 1831f10105 fix(config): enforce safe default network binding (#3684)
* fix: enforce safe default network binding

* fix(config): keep signed test authority stable

Pin the integration-test listener to the existing all-interface test bind and
opt into that bind only in the test profile. This preserves localhost-based
SigV4 fixtures while production keeps the loopback default.

* fix(config): keep compat image backward compatible

* chore: retrigger CI

* fix(config): mirror JVM image network binding
2026-09-16 14:46:09 -04:00
Hector Ventura b0a8dff206 perf(docker): drop the gosu layer and two no-op native-image inputs (#3037)
The native image's tools layer installed shadow-utils, which ubi9-minimal
9.7 already ships, and downloaded a gosu binary: 19 MB on disk, 3.66 MB
compressed, byte-identical on every release since 1.5.34. The entrypoint
still starts as root and still grants the bind-mounted Docker socket's
group to the floci user, but through coreutils, which the base image has:
`chroot --userspec=1001:0 --groups=0,<socket gid> --skip-chdir /` drops to
uid 1001 with the socket's gid as a supplementary group. The group is
passed by number, so no /etc/group entry is needed, and --skip-chdir keeps
/app as the working directory where the relative ./data paths resolve. The
layer is now 24.6 kB (one useradd). The JVM Dockerfile drops its gosu
download too: the entrypoint is shared, so once it execs chroot nothing
there calls gosu. Floci's release and nightly pipelines never publish that
image; build-images.yml is a reusable workflow a fork invokes to publish its
own copy, and its noble base carries the same coreutils chroot flags.

Two inputs to the native build go with it, neither changing a byte:
--allow-incomplete-classpath and --report-unsupported-elements-at-runtime
have been no-ops since GraalVM 22.1 (Quarkus passes --link-at-build-time
itself, so a missing reachable class already fails the build), and the
brotli4j platform JNI jars are excluded from quarkus-rest-jackson because
Floci never enables Brotli compression and the jar was never embedded
(resource count unchanged at 197). A native build without them produces
the same 232.25 MB image and the same reachable set.

Verified on the arm64 image: uid=1001 gid=0; a socket owned by gid 999
yields groups=0,999 end to end; /app/data writable; argv fallthrough
intact; sdk-test-java compat suite 1,667/1,667 against the native image
with the socket mounted.
2026-09-04 22:30:28 -04:00
Jason van Zyl 42d94c62ee ci: add reusable JVM and native image publishing (#1936)
* ci: add reusable image publishing

Provide a workflow_call contract that builds native amd64 and arm64 artifacts and publishes native and compat multi-architecture images for an exact caller-selected source revision. Keep registry authority in the caller and return immutable digest references plus provenance for downstream tests.

* fix(docker): use glibc in JVM development image

Use an Ubuntu-based Java 25 runtime so the JVM image can host glibc-linked integrations while preserving the existing entrypoint, tooling, and architecture behavior.

* ci: publish JVM images by default

* fix(ci): harden reusable image builds

* docs(ci): clarify image registry input

* fix(docker): locate the installed AWS CLI

* fix(ci): tag images by build time and revision
2026-08-05 17:06:07 -05:00
Juri Duval 7ade290312 fix(dockerfile): ensure docker-java compatibility (#2096) 2026-08-03 23:43:09 -05:00
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
Hector Ventura 3c98efe615 chore: new docker image tag and compatibility (#691)
* chore: new docker image tag and compatibility
* chore: change nightly workflow schedule time
2026-05-02 22:46:25 -05:00