You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think we should at least try to rejigger our Teraslice Dockerfile to try and eliminate the need for maintaining our own base image. I think the approach would be to use a Multistage Dockerfile (https://docs.docker.com/build/building/multi-stage/) whose first stage creates a temporary "dev image" (not pushed anywhere) that has all the node-gyp C dependencies and builds Teraslice. Then the second stage will build a smaller final image from the output of the dev image.
I think we can still parameterize the Node version the same way we are now. Our main goal here is to isolate the changes as much as possible in the Dockerfile and making sure what we build passes e2e tests.
Ref:
When considering naming schemes for our Docker images in the issue below, I thought its probably worth trying out:
godber
changed the title
Use a Multie stage Dockerfile to eliminate the need for our own base image
Use a Multi stage Dockerfile to eliminate the need for our own base image
Jan 9, 2024
Rewrite Teraslice Dockerfile to be multistage and use node image
This PR makes the following changes:
- Rewrite docker file:
- Discontinue use of `base-docker-image`
- Create a multi-stage build:
- base stage:
- build image from `debian-bookworm`
- combine functionality from the `base-docker-image` with the yarn build
step to create `/app` directory
- second stage:
- build image from `debian-bookworm-slim`
- copy `/app` artifact from base stage, minimizing dependencies
- Copy the following scripts from `base-docker-image` repo to
`teraslice/scripts`:
- `docker-pkg-fix.sh` (this doesn't seem to be used anywhere)
- `wait-for-it.sh`
Ultimately the goal is to not have to manage our own base image.
ref: #3518
---------
Co-authored-by: Austin Godber <[email protected]>
I think we should at least try to rejigger our Teraslice
Dockerfile
to try and eliminate the need for maintaining our own base image. I think the approach would be to use a Multistage Dockerfile (https://docs.docker.com/build/building/multi-stage/) whose first stage creates a temporary "dev image" (not pushed anywhere) that has all thenode-gyp
C dependencies and builds Teraslice. Then the second stage will build a smaller final image from the output of the dev image.Roughly speaking:
FROM
one of these: https://hub.docker.com/_/nodebookworm
, thenbullseye
, thenalpine
bookworm
, and the final image should bebookworm-slim
(adjust debian release name as appropriate)I think we can still parameterize the Node version the same way we are now. Our main goal here is to isolate the changes as much as possible in the
Dockerfile
and making sure what we build passese2e
tests.Ref:
When considering naming schemes for our Docker images in the issue below, I thought its probably worth trying out:
https://github.com/terascope/debian-base/issues/1#issuecomment-1883904854
The text was updated successfully, but these errors were encountered: