Commit Graph
21 Commits
Author SHA1 Message Date
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
Liam MacPherson 9e90e5cff3 perf(docker): stop duplicating the native binary into a second image layer (#2069)
Both native Dockerfiles wrote the ~196 MB binary into the image twice. A RUN that
renames or chmods a large file rewrites the whole file into a new layer, so the
published image carried two copies of it:

    110 MB   ubi9-minimal base
    18.8 MB  microdnf install
    196 MB   COPY --chown=1001:root native/<arch>/ /app/
    196 MB   RUN mv /app/*-runner /app/application && chmod +x /app/application

Set the mode in the COPY itself and move the rename out of the image and into the
build pipeline, which now stages the binary as native/<arch>/application.
Dockerfile.native does the same with a single COPY --chmod=755 --from=build.

Measured on linux/arm64 against floci/floci:1.5.34, with a 196 MB binary on both
sides so the comparison is like for like:

    uncompressed   521 MB -> 325 MB
    compressed     168 MB -> 104 MB   (sum of gzip -6 layer blobs; Docker Hub
                                       reports 166.1 MB for 1.5.34)
    layers           8    -> 6

No behaviour change. The only filesystem difference in the resulting image is
quarkus-artifact.properties, now 0755 rather than 0644, because --chmod applies to
every file in the staged directory. /app and /app/data keep 0775 and uid 1001:0 for
arbitrary-uid (OpenShift) runs, and /app/application keeps 0755 — docker/entrypoint.sh
gates its default command on [ -x /app/application ].
2026-07-31 22:02:59 -05:00
Hector Ventura fe49bee41e fix(s3): fail fast on unwritable data root instead of opaque 500s (#1868)
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
2026-07-15 00:43:11 -04:00
Hector Ventura fb546d54c4 fix(docker): enable TLS and sync docker test runner with compatibility workflow (#1714)
* fix(docker): enable TLS and sync docker test runner with compatibility workflow

The local docker compose stack ran without FLOCI_TLS_ENABLED and the EC2 mock,
and run-docker-tests.sh lacked the hot-reload bind mount, so the node TLS/WSS
suites and the Java Lambda hot-reload test failed locally while passing in CI.
Mirror the compatibility workflow's configuration so local runs exercise the
same setup.

* fix: remove FLOCI_SERVICES_EC2_MOCK from docker-compose

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

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-07-03 01:10:06 -05:00
Hector Ventura 68fc4134c4 fix(iot): deflake MQTT lazy-startup test, align 1.5.28 version, make compat runner executable (#1580)
* test(iot): wait for broker port release in MQTT lazy-startup test

Vert.x MqttServer.close() can resolve before the OS releases the listening
socket, so a connect immediately after stop() may still succeed. @BeforeEach
now polls until the port refuses connections before each test asserts the
broker is not listening, fixing the IotMqttLazyStartupIntegrationTest flake
under the full ordered suite that was failing CI on main.

* chore(release): set version to 1.5.28

Align pom.xml with the 1.5.28 release commit and CHANGELOG header; it had
been left at 1.6.0.

* ci: make run-docker-tests.sh executable

The compat test runner lacked the execute bit, so ./docker/run-docker-tests.sh
failed with permission denied (exit 126).
2026-06-26 01:35:39 -05:00
Hector Ventura b9da266b16 ci: build native compat image on runner and run full matrix against it (#1578)
Replace the in-container GraalVM build (docker/Dockerfile.native) with a
runner build via graalvm/setup-graalvm + Maven cache, using the -Ob quick
build (appended so application.yml native args are preserved). The prebuilt
binary is packaged through docker/Dockerfile.native-package, matching the
nightly/release pipeline. Both jobs run on ubuntu-24.04-arm.

Drop the JVM build/compat-test jobs and run the full 8-test matrix against
the native image (porting the compat-cdk Docker-socket case). Remove the now
orphaned docker/Dockerfile.jvm-package.
2026-06-25 19:09:11 -05:00
Jason van Zyl ad785f95f6 feat(ec2): add Java-built Ubuntu AMI guest image (#1542) 2026-06-25 00:33:15 -05:00
TomDav28andTomer David ed74698d48 fix(compat): pre-create localstack/floci init hook dirs (#1337)
Co-authored-by: Tomer David <tomer.david+catonian@catonetworks.com>
2026-06-14 09:51:26 -05:00
TomDav28 3b03b1363c fix(docker): fall back to the default command when entrypoint argv is empty (#1283) 2026-06-10 07:40:05 -05:00
Hector Ventura 3387d29346 fix: move all built to graalvm 25 (#1107) 2026-05-31 10:23:13 -05:00
Hector Ventura 0123844d83 chore(docker): add OCI image metadata labels (#872)
* chore(docker): add OCI image metadata labels

Add OCI image spec labels to Dockerfile.native-package, Dockerfile.jvm-package,
and Dockerfile.compat so published images carry standard metadata.

Static labels (title, description, url, source, licenses, vendor) are baked into
the Dockerfiles and are present in every build including local ones. Dynamic labels
(version, revision, created) are injected at publish time via the labels: input of
build-push-action in release.yml and nightly.yml.

Closes #851

* chore: setting not opencontainers labels
2026-05-17 00:25:24 -05:00
Hector Ventura c8c77c9e6e feat(s3): virtual-hosted style addressing support (#805)
*.s3.localhost.floci.io, *.localhost.localstack.cloud, and
  *.s3.localhost.localstack.cloud as virtual-hosted style regardless of
  FLOCI_HOSTNAME — fixes 405 when SDK uses endpointOverride("http://localhost:4566")
  without forcePathStyle (closes #801)
- EmbeddedDnsServer ships localhost.localstack.cloud and localhost.floci.io
  as built-in suffixes so spawned containers resolve these domains to Floci's
  IP without extra config
- Compatibility test S3VirtualHostStyleTest covers the full virtual-host path
  end-to-end; TestFixtures.s3VirtualHostClient() prefers s3.localhost.floci.io,
  falls back to s3.localhost.localstack.cloud, or uses FLOCI_S3_VHOST_ENDPOINT
  in Docker
- run-docker-tests.sh and compatibility.yml inject --dns <floci-ip> and
  FLOCI_S3_VHOST_ENDPOINT=http://floci:4566 into test containers
- S3 and migrate-from-localstack docs updated with virtual-hosted style details
2026-05-11 23:53:28 -05:00
Hector Ventura 9e35046647 Docs/enviroment instead yml (#764)
* docs: moving all config to env instead of yml
* docs: sync with main and new features
* docs: reverting docker-compose.yml
2026-05-10 11:53:31 -05:00
5befe8b619 feat: optional TLS/HTTPS support with self-signed certificate generation (#754)
* feat: optional TLS/HTTPS support with self-signed certificate generation

- Add TlsConfigSource (MicroProfile ConfigSource SPI) that injects Quarkus
  TLS properties before the HTTP server starts
- Auto-generate self-signed certificates with correct SANs including custom
  hostnames from FLOCI_HOSTNAME and FLOCI_BASE_URL
- Persist certificate metadata for change detection across restarts
- Fix CertificateGenerator to encode IP addresses as iPAddress SANs (RFC 5280)
- Serve HTTP + HTTPS simultaneously (LocalStack parity)
- Support user-provided certificates via FLOCI_TLS_CERT_PATH/KEY_PATH
- Add TLS configuration documentation
- Add Node.js SDK compatibility test for HTTPS connectivity
- Add comprehensive unit and integration tests (79 test cases)

Closes #711

* feat(tls): add TLS proxy server and WebSocket-over-TLS tests

- Add TlsProxyServer: TCP proxy on port 4566 that detects TLS ClientHello
  and routes to HTTPS (4511) or HTTP (4510) backend accordingly
- Add apigatewayv2-websocket-tls.test.ts: WSS compatibility tests covering
  connect/disconnect, route selection, broadcast, authorization,
  @connections API, binary frames, and payload size limits
- Update CI workflow to enable FLOCI_TLS_ENABLED=true for compat tests
- Update sdk-test-node Dockerfile with NODE_TLS_REJECT_UNAUTHORIZED=0
- Update tls.test.ts for HTTPS SDK client tests
- Update README with WebSocket-over-TLS test documentation

* fix(tls): address review comments — LocalStack parity and floci.io SANs

- Add USE_SSL and CUSTOM_SSL_CERT_PATH mappings to localstack-parity.sh
- Add localhost.floci.io and *.localhost.floci.io to default certificate SANs
- Update affected tests and documentation

---------

Co-authored-by: Dixit R Jain <dixitrjain@Mac-379.lan>
Co-authored-by: Dixit R Jain <dixitrjain@Mac.lan>
2026-05-10 10:21:03 -05:00
Niklas Herder 97b08f62bc chore(docker): ship awslocal wrapper in the -compat image (#746)
* chore(docker): ship awslocal wrapper in the -compat image

bin/awslocal was added to the repo in #638 but is not COPYed into any of
the published Docker images. That makes existing LocalStack init scripts
mounted at /etc/localstack/init/ready.d/ — which overwhelmingly use
`awslocal kinesis …` rather than `aws --endpoint-url=… kinesis …` —
fail with "command not found" on the supposedly drop-in -compat image.

The script also needed an entry in .dockerignore: the file is allow-list
style ("*" + "!path") and bin/awslocal was not in the allow list, so it
never reached the build context. Without that line the COPY fails with
"file not found in build context".

Closes #744. The orthogonal SQS endpoint-resolver issue tracked in #745
is unaffected by this change — awslocal as written only exports
AWS_ENDPOINT_URL, which the bundled botocore silently ignores for SQS.

* fix(awslocal): pass --endpoint-url explicitly to honor hard-pin contract

LocalStack's awslocal idiom is "hard-pin the endpoint" — that's the whole
point of the wrapper. Setting AWS_ENDPOINT_URL alone is not sufficient:
the bundled aws-cli/1.44.87 + botocore/1.42.97 silently bypasses the env
var for SQS via service-specific endpoint resolvers, sending requests
to public AWS. With real credentials in CI/dev, that would silently
provision real SQS queues — surfacing as the InvalidClientTokenId error
documented in #745.

Inject --endpoint-url before "$@" so the user's own --endpoint-url (if
any) still wins via last-flag-wins. Verified: awslocal sqs create-queue
and list-queues now route to Floci; kinesis/s3 still work; awslocal env
subcommand unaffected; user override behaves correctly.

Addresses Copilot's review feedback on #746 and the awslocal arm of #745.
2026-05-08 07:48:21 -05:00
Leonid Bogdanov 5d51052a51 fix(docker): /etc/floci/aws/config missing in published Docker images (#740)
* fix(docker): /etc/floci/aws/config missing in published Docker images

* Address PR feedback
2026-05-07 22:23:30 -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 db9eedc4cd chore: fix dockerfile issue with argument parameter 2026-05-02 23:21:38 -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
Conor Heine 43e9ca18a0 fix(docker): make bind-mounted /var/run/docker.sock work on all hosts (#602)
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.
2026-04-25 14:09:11 -05:00