Use docker hardened images #414
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request updates the SDK's Docker build process and related configuration to improve image security and flexibility. The main changes include switching to hardened base images from a private registry, splitting PostgreSQL images into build and runtime variants, and refining the Dockerfile to streamline dependencies and user creation.
Container base image and registry updates:
dhi.iofor improved security (packages/sdk/docker-bake.hcl).dhi.io) before building images (.github/workflows/sdk.yaml).PostgreSQL image improvements:
dhi.iofor production, with configurable major version support (packages/sdk/docker-bake.hcl,packages/sdk/Dockerfile). [1] [2] [3]packages/sdk/Dockerfile).Dockerfile dependency and user management:
passwd), then remove them immediately after use to reduce image size and attack surface (packages/sdk/Dockerfile). [1] [2]lua5.4andxz-utilsfrom the runtime dependencies (packages/sdk/Dockerfile).Build process enhancements:
/usr/local/bindirectory exists before extracting binaries, improving reliability during the build (packages/sdk/Dockerfile).forgebinary is included, copying it from a prior build stage instead of downloading it again, which improves build caching and consistency (packages/sdk/Dockerfile).