Skip to content
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

fix: reduce size of docker image by leveraging a multi-stage build #180

Merged
merged 1 commit into from
May 17, 2023

Conversation

therealdwright
Copy link
Contributor

@therealdwright therealdwright commented May 17, 2023

The current docker image builds to about 2.7GB on my machine, this
can be improved through leveraging multi-stage builds in docker.

With this commit, the new image size will be less than 200mb and
the necessary binaries are copied to /usr/local/bin

Closes #175

Copy link
Collaborator

@devstein devstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for making a PR! One quick question

Dockerfile Outdated Show resolved Hide resolved
The current docker image builds to about 2.7GB on my machine, this
can be improved through leveraging multi-stage builds in docker.

With this commit, the new image size will be less than 200mb and
the necessary binaries are copied to /usr/local/bin

Closes viaduct-ai#175
Copy link
Collaborator

@devstein devstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@devstein devstein merged commit 51fdcbb into viaduct-ai:master May 17, 2023
@@ -4,7 +4,8 @@ ARG GO_VERSION="1.19"
#--------Build KSOPS and Kustomize-----------#
#--------------------------------------------#

FROM golang:$GO_VERSION
# Stage 1: Build KSOPS and Kustomize
FROM golang:$GO_VERSION AS builder

LABEL org.opencontainers.image.source="https://github.com/viaduct-ai/kustomize-sops"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The LABEL needs to be moved down to the final image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@therealdwright therealdwright deleted the reduce-docker-image-size branch May 17, 2023 02:45
therealdwright added a commit to therealdwright/kustomize-sops that referenced this pull request May 17, 2023
devstein pushed a commit that referenced this pull request May 17, 2023
@Piroddi
Copy link

Piroddi commented May 17, 2023

Hi, this PR has made the Custom ArgoCD Image doc outdated:

https://github.com/viaduct-ai/kustomize-sops#custom-argo-cd-w-ksops-dockerfile

@therealdwright
Copy link
Contributor Author

Hi, this PR has made the Custom ArgoCD Image doc outdated:

Thanks for flagging @Piroddi - I'll push a PR to fix the docs today.

therealdwright added a commit to therealdwright/kustomize-sops that referenced this pull request May 17, 2023
This commit changes the version of both argocd and ksops to newer
versions and changes the paths to reflect what is configured in the
new slim docker image introduced in viaduct-ai#180

ArgoCD v2.6.7 is the latest version available on the argoproj docker
registry at the time of this commit.
devstein pushed a commit that referenced this pull request May 18, 2023
This commit changes the version of both argocd and ksops to newer
versions and changes the paths to reflect what is configured in the
new slim docker image introduced in #180

ArgoCD v2.6.7 is the latest version available on the argoproj docker
registry at the time of this commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docker images are large
4 participants