Distroless builds: Node-something-distroless examples + nginx + mcp server - #461
Open
cosmintanasa47 wants to merge 18 commits into
Open
cosmintanasa47 wants to merge 18 commits into
cosmintanasa47 wants to merge 18 commits into
Conversation
Use nodejs24-debian12 distroless image to run the server. It fits best with the build image. Copy only necessary executables and libraries. Out of the three executables copied initially, only /bin/sh is mandatory because of the entrypoint.sh scrypt that runs node.
Modify the exec command to be able to run node. It had to match the distroless image's node path. Previous: exec node ... Current: exec /nodejs/bin/node ...
Slightly modify to fit new distroless version.
Slightly modify to fit new distroless version.
Unmodified files from non-distroless version.
Use bookworm for build stage to be compatible with cc-debian12 distroless runtime image. Node's odd versions do not have available distroless images so used a cc image.
Slightly modify to fit new distroless version.
Slightly modify to fit new distroless version.
Unmodified files from non-distroless version.
Modify dockerfile so that it has a "runtime" stage that is based on a distroless node18 image from google. Kraftfile is modified so that node's path is the one at which node is present in the distroless image. Slightly modify test file and README to fit this distroless version.
Add Dockerfile with an additional stage that is based on a distroless node18 image from google. Modify Kraftfile's node path so that it matches distroless image's path to nodejs. Slightly modify test file and README so they fit for this new distroless version.
Modify Dockerfile so that it builds the second stage with a distroless node22 image from google. This eliminated the copying of node binary and libraries. Modify Kraftfile so the node binary path fits distroless image's node path. Slightly modify test file and README to fit new distroless version. Kept unmodified from the original non-distroless version: dockerignore, gitignore, package.json,wrapper.sh, server.js.
Modify Dockerfile so that it builds the second stage with a distroless node22 image from google. This eliminated the copying of node binary and libraries. Modify Kraftfile so the node binary path fits distroless image's node path. Slightly modify test file and README to fit new distroless version. Kept unmodified from the original non-distroless version: dockerignore, gitignore, package.json,wrapper.sh, server.js.
Modify Dockerfile so that it builds the second stage with a distroless node22 image from google. This eliminated the copying of node binary and libraries. Modify Kraftfile so the node binary path fits distroless image's node path. Slightly modify test file and README to fit new distroless version. Kept unmodified from the original non-distroless version: dockerignore, gitignore, package.json,wrapper.sh, server.js.
Modify Dockerfile to have a distroless "runtime" stage that is based on a distroless node25 image. Modify Kraftfile's node binary path and source file path to fit to the disign of the used distroless image. Slightly modify test file and README to fit new distroless version. Didn't modify other files from non-distroless version.
Switch from a two-stage Dockerfile to a one-stage Dockerfile so it uses a distroless nginx image that eliminates the copying of system and nginx libraries. Modify Kraftfile so nginx binary path respects the distroless image's nginx binary path. Slightly modify test file and README so it fits for the new distroless version. Didn't modify the other files added from the original non-distroless version.
Modify Dockerfiles for each part to run on a distroless image. For mongo and flask used a cc image because mongo do not have a distroless docker image and python3.12 also do not have an image, there are images compatible only with python3.11 and python3.13. Modify KRaftfiles to point to the exact paths for it's binaries (nginx, python and mongod) considering the distroless images. Same for entrypoint.sh. Modify test file and README to fit new distroless version.
Modify Dockerfile so the server runs on a distroless image. This excluded the copying of system and python libraries, but also python interpretor and other libraries. The distroless stage just copies the dependencies resolved in the build stage and with a compatible interpretor it runs the python mcp server. Modify README and test file so it fits the new distroless version. Kraftfile and the rest of the files weren't modified. Those are the same as the ones in the non-distroless example.
Author
|
Also added two nginx examples and one mcp server. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Those are the distroless examples for node distroless builds for non-httpserver examples. Details about the implementation in each modified files's commit message.