Skip to content

Use Alpine Linux as the parent image for the registry. - #1626

Merged
RichardScothern merged 1 commit into
distribution:masterfrom
RichardScothern:alpine
May 4, 2016
Merged

RichardScothern merged 1 commit into
distribution:masterfrom
RichardScothern:alpine

Conversation

@RichardScothern

@RichardScothern RichardScothern commented Apr 13, 2016 •

Copy link
Copy Markdown

Signed-off-by: Richard Scothern [email protected]

@RichardScothern

Copy link
Copy Markdown
Author

@dmp42 @dmcgowan system certs tested with s3 storage driver over TLS

@codecov-io

Copy link
Copy Markdown

Current coverage is 51.18%

Merging #1626 into master will decrease coverage by -6.74% as of e8feabc

@@            master   #1626   diff @@
======================================
  Files          122     122       
  Stmts        10683   10683       
  Branches       839     748    -91
  Methods          0       0       
======================================
- Hit           6188    5468   -720
+ Partial        839     748    -91
- Missed        3656    4467   +811

Review entire Coverage Diff as of e8feabc


Uncovered Suggestions

  1. +0.30% via .../driver/s3-aws/s3.go#732...763
  2. +0.28% via .../driver/s3-aws/s3.go#268...297
  3. +0.21% via .../driver/s3-aws/s3.go#884...906
  4. See 7 more...

Powered by Codecov. Updated on successful CI builds.

@dmp42

dmp42 commented Apr 13, 2016

Copy link
Copy Markdown
Contributor

Indeed certs might be an issue - a S3 + CF test would be nice.

@aaronlehmann

Copy link
Copy Markdown

Are you planning to do the same for the official image here? https://github.com/docker/distribution-library-image/blob/master/Dockerfile

I like this change, but I think we should only do it if the official image will also be based on alpine.

Comment thread Dockerfile Outdated

ENV CGO_ENABLED=0

RUN make DOCKER_BUILDTAGS=netgo PREFIX=/go clean binaries

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It might be good to run ldd and confirm that registry is a static binary. I've sometimes had trouble with the Go linker's behavior changing between versions, or being influenced by code changes. To avoid creating an extra layer, this could be added to this RUN command with &&.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

That's fine.

And to your above question, yes the official image will be based on Alpine (3.3)

@dmcgowan

Copy link
Copy Markdown
Collaborator

What is the reason for ensuring the binary is static if we are also releasing on alpine? I don't think it will be an issue here but it does limit which packages can be imported by the registry in the future.

@RichardScothern

Copy link
Copy Markdown
Author

Originally, to put the official image into a FROM scratch Dockerfile. Is
there a good reason for it to by dynamically linked?

On Wed, Apr 13, 2016 at 10:09 AM, Derek McGowan [email protected]
wrote:

What is the reason for ensuring the binary is static if we are also
releasing on alpine? I don't think it will be an issue here but it does
limit which packages can be imported by the registry in the future.

—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#1626 (comment)

@dmcgowan

Copy link
Copy Markdown
Collaborator

@RichardScothern I can't call CGO a good reason, if we don't need it all the better. My point was more that whether it is or isn't static does not need to be enforced or checked.

LGTM

@aaronlehmann

Copy link
Copy Markdown

These are all good points, but I would argue that either we care about creating static binaries or not. If we don't care, we shouldn't be specifying things like -tags netgo, and should instead respect the defaults. If we do care, we should be checking that the flags are producing the desired result.

Comment thread Dockerfile
RUN apt-get update && \
apt-get install -y apache2-utils && \
rm -rf /var/lib/apt/lists/*
FROM golang:1.6-alpine

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Let's make this golang:1.6.1-alpine.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

If go 1.6.2 is released, and we are using golang:1.6.1-alpine upgrading will be more painful. (a fact I'm discovering with the go 1.5.4 release)

@RichardScothern

Copy link
Copy Markdown
Author

Agreed. For simplicity sake (fewer flags, no ldd check) and because there is no compelling reason not to) let leave it as dynamically linked.

@aaronlehmann

Copy link
Copy Markdown

LGTM

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.

7 participants