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

New dockerfile that can build by itself #78

Merged
merged 1 commit into from
Apr 18, 2017

Conversation

christophermaier
Copy link
Collaborator

@christophermaier christophermaier commented Apr 17, 2017

Previously, we'd build a glibc Relay locally and then stuff that into a
minimal Docker image and provide that. Now, we do the build of Relay
inside the image build itself. I have confirmed that an executable built
in this Alpine image runs fine in a Debian (i.e., glibc) system.

However, this results in a larger image size right now. Compare the
previous sizes to what is currently built by this commit:

Image Compressed Uncompressed
Previous 6 MB 19.9 MB
Current 30 MB 81.6 MB

This allows us to easily automate the build with DockerHub, though,
because it doesn't require anything besides the Dockerfile.

See operable/cog#1384 for more.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 20.893% when pulling 09ff8bf on cm/consolidate-dockerfile into 726704b on master.

Copy link
Contributor

@jesselang jesselang left a comment

Choose a reason for hiding this comment

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

Looks great, Chris!

Dockerfile Outdated
WORKDIR /gopath/src/github.com/operable/go-relay
COPY . /gopath/src/github.com/operable/go-relay

RUN apk -U add \
Copy link
Contributor

Choose a reason for hiding this comment

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

It's common to use apk -U add --virtual .build_deps <packages> followed by apk del .build_deps && rm -rf /var/cache/apk/* Not sure if that would help squeeze anything more out of the image.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@jesselang I'll go ahead and add the virtual package if for no other reason than to promote good patterns via copy and paste 😄

I'd forgotten about removing the APK cache; I'll give that a try this evening and see if it helps. Either way, I'll merge it afterward.

Thanks for the review!

Previously, we'd build a glibc Relay locally and then stuff that into a
minimal Docker image and provide that. Now, we do the build of Relay
inside the image build itself. I have confirmed that an executable built
in this Alpine image runs fine in a Debian (i.e., glibc) system.

However, this results in a larger image size right now. Compare the
previous sizes to what is currently built by this commit:

| Image    | Compressed | Uncompressed |
| -------- | ---------- | ------------ |
| Previous | 6 MB       | 19.9 MB      |
| Current  | 30 MB      | 81.6 MB      |

This allows us to easily automate the build with DockerHub, though,
because it doesn't require anything besides the Dockerfile.

See operable/cog#1384 for more.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 20.893% when pulling 8eb92aa on cm/consolidate-dockerfile into 726704b on master.

@christophermaier christophermaier merged commit 7047950 into master Apr 18, 2017
@christophermaier
Copy link
Collaborator Author

@jesselang That shaved off another ~0.8MB, so 👍

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.

3 participants