Commit Graph
11 Commits
Author SHA1 Message Date
Hector Ventura a6bd0554a7 perf(docker): trim the compat image's CLI extras and Python build leftovers (#3108)
The AWS CLI v2 install ships 26 MB of `aws <command> help` example pages
that were never viewable in this image: help rendering needs groff or
mandoc and ubi9-minimal has neither, so `aws sqs help` already failed
before this change. Tab completion has no user inside a container either,
so aws_completer (9 MB), its ac.index database (21 MB) and the /usr/bin
symlink the installer creates go with it. The command reference the CLI
reads at run time (dist/awscli/data) stays.

pip and setuptools stay: the image documents pip and init hooks use it to
install packages. The system Python loses only build-time extras nothing
imports at run time: the optimised .pyc variants, lib2to3 and ensurepip
(removed with a python3 one-liner, ubi9-minimal has no find). awslocal's
mode is set in the COPY instead of a chmod layer.

Measured on arm64 on top of #3085: compat image 924 to 839 MB on disk,
214.0 to 197.7 MB gzip; /usr/local/aws-cli 264 to 209 MB. Verified: aws
2.36.24, `aws sqs list-queues` still resolves its model, pip3 installs a
package, boto3 1.42.97 import with json, ssl and sqlite3, awslocal, init
hooks calling all three, the container healthy in 5 s, and the four
endpoint-resolution checks compatibility.yml runs against this image.
2026-09-05 19:25:01 -05:00
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
MakerYuichianddoraemon2200 9fda5f5919 fix(compat): install AWS CLI v2 in the compat image so AWS_ENDPOINT_URL is honored (#2315)
* fix(compat): shim aws to inject --endpoint-url from AWS_ENDPOINT_URL, add CI smoke test

* fix(compat): migrate to AWS CLI v2, drop the endpoint-url shim

---------

Co-authored-by: doraemon2200 <106516578+doraemon2200@users.noreply.github.com>
2026-08-16 20:26:56 -05: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
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
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
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