-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multistage build (enhancement) #447
multistage build (enhancement) #447
Conversation
Hi @denisandreenko and thanks for the PR! We use Goreleaser for building, packaging, and publishing Signatory in different formats(Binaries and Docker) and for different OS(Linux, Mac, Windows). Specifically, we use Goreleaser requires copying pre-compiled binaries to the Docker image as mentioned in the docs, which is why we can't move to multi-stage builds. |
However I'll test your multi-stage Dockerfile with a Yubikey. If it works out fine we could have 2 Dockerfiles; we could append |
Sounds good to me. Thanks @danielelisi for your review! |
I've separated dockerfiles. Please check that goreleaser works as expected, since I don't have access to your environment. |
4355c5a
to
94b6383
Compare
Hi @danielelisi ✋ Did you have a chance to look at it? |
Signed-off-by: Dzianis Andreyenka <[email protected]>
Signed-off-by: Dzianis Andreyenka <[email protected]>
Signed-off-by: Dzianis Andreyenka <[email protected]>
Signed-off-by: Dzianis Andreyenka <[email protected]>
3ba245f
to
1bf7d0c
Compare
@GImbrailo tested the image produced by the multistage build and confirmed that yubiHSM works correctly. I'll proceed and merge this |
🚀 Pull Request: Optimizing Docker Build Process with Multistage Build and Cache Busting
📝 Description:
This pull request introduces several enhancements to our Docker build process, resulting in faster and more efficient container image builds. I've implemented a multistage build approach, added a .dockerignore file, and incorporated cache busting techniques to improve the overall development workflow and reduce image size.
🏗️ Changes Made:
Multistage Build: I've revamped our Dockerfile to utilize a multistage build approach. The multistage build significantly reduces the final image size by building only the necessary artifacts and dependencies needed to run the application. This not only improves the efficiency of the build process but also ensures a leaner production image.
.dockerignore File: Introduced a .dockerignore file to exclude unnecessary files and directories from being copied into the Docker context during the build process. This reduces the amount of data that Docker needs to process and speeds up the initial build, as well as subsequent builds using cache.
Cache Busting: To prevent unnecessary layers from being cached during the build process, I've implemented cache busting techniques for certain steps in the Dockerfile.
📈 Expected Impact:
Please review the code changes. Your feedback and suggestions are greatly appreciated!
🙌 Thank you!