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

Allow building the signer from source whilst still keeping container size down #11

Closed

Conversation

lag-linaro
Copy link
Contributor

Fixes: #7
Fixes: docker-library/official-images#4718
Fixes: notaryproject/notary#1380

Commit 3246cae (Notary 0.6.1, and rather than commit binaries,
build using multistage dockerfiles.) provided support for building
binaries from source, instead of introducing them into the repo. It
also introduced multi-stage builds into the project.

Multi-stage builds allow us to supply all of the build requirements
into disposable build-containers. Once finished with, only the
required build artifacts are copied out into a nice succinct run-
container. This results in a container with a much smaller
footprint.

The issue is; Docker's Official Images platform does not yet support
multi-stage builds. So until they do, we need to find a source of
compromise.

Here we start with a small base (Alpine), install only the build
requirements we need, build from source, then once complete clean-up
any unnecessary packages. This both allows for building from source
AND keeps the final run-container nice and small.

Signed-off-by: Lee Jones lee.jones@linaro.org

…size down

Commit 3246cae (Notary 0.6.1, and rather than commit binaries,
build using multistage dockerfiles.) provided support for building
binaries from source, instead of introducing them into the repo. It
also introduced multi-stage builds into the project.

Multi-stage builds allow us to supply all of the build requirements
into disposable build-containers.  Once finished with, only the
required build artifacts are copied out into a nice succinct run-
container.  This results in a container with a much smaller
footprint.

The issue is; Docker's Official Images platform does not yet support
multi-stage builds.  So until they do, we need to find a source of
compromise.

Here we start with a small base (Alpine), install only the build
requirements we need, build from source, then once complete clean-up
any unnecessary packages.  This both allows for building from source
AND keeps the final run-container nice and small.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
@@ -1,27 +1,36 @@
FROM golang:1.10.3-alpine
FROM alpine:latest
Copy link

Choose a reason for hiding this comment

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

This should be a specific version of Alpine, like 3.8, to prevent possible incompatibilities (like when they switch ssl back to openssl).

@lag-linaro
Copy link
Contributor Author

Moved into #10

@lag-linaro lag-linaro closed this Nov 5, 2018
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.

2 participants