openshift / image-inspector

Apache License 2.0
34 stars 29 forks source link

build: add multi-stage build support #59

Closed simon3z closed 4 years ago

simon3z commented 7 years ago

Adding the support for multi-stage builds we save ~92MB in image size (97MB vs 189MB).

At the moment we lose the automated builds on dockerhub (which I wasn't using anyway) until the official multi-stage build will be available (docker 1.17 IIRC).

cc @pweil- @ilackarms @mfojtik

simon3z commented 7 years ago

I updated the PR in a hurry let me know if I missed something.

ilackarms commented 7 years ago

i think this might be a good PR in which we evaluate the many different ways to build image-inspector:

build.sh + Dockerfile.build + Dockerfile Makefile hack/build-go.sh

One problem, for example, with having many separate routes for building is that travis builds will fail even if the Docker build passes. I think we should have one build path which the Docker build process consumes internally.

Dockerfile.build should make use of make which in turn should make use of hack/ scripts. This way we reduce code duplication and make sure we are testing our build process with travis

cben commented 6 years ago

The new multi-stage syntax (https://docs.docker.com/develop/develop-images/multistage-build/) is cleaner and by now supported in docker hub autobuilds (https://github.com/docker/hub-feedback/issues/1039).

(btw same document also explains well the build.sh + Dockerfile.build + Dockerfile pattern used here)

openshift-bot commented 4 years ago

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

openshift-bot commented 4 years ago

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten /remove-lifecycle stale

openshift-bot commented 4 years ago

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen. Mark the issue as fresh by commenting /remove-lifecycle rotten. Exclude this issue from closing again by commenting /lifecycle frozen.

/close

openshift-ci-robot commented 4 years ago

@openshift-bot: Closed this PR.

In response to [this](https://github.com/openshift/image-inspector/pull/59#issuecomment-716041167): >Rotten issues close after 30d of inactivity. > >Reopen the issue by commenting `/reopen`. >Mark the issue as fresh by commenting `/remove-lifecycle rotten`. >Exclude this issue from closing again by commenting `/lifecycle frozen`. > >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.