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

Introduce dockercore/buildbase x64 base image #20665

Closed
wants to merge 1 commit into from

Conversation

icecrime
Copy link
Contributor

Split the build Dockerfile in two, and extra the most stable pieces of the build environment into a dockercore/buildbase image.

The goal is to minimize build times for the most traditional use cases, while minimizing the dependencies to external services in our build process.

Before:

$ time docker build -t dev:master --no-cache .
[...]
Successfully built 3b3266760378

real    11m16.799s
user    0m4.772s
sys     0m0.672s

$ docker images
REPOSITORY                       TAG                 IMAGE ID            CREATED             SIZE
dev                              master              3b3266760378        8 minutes ago       2.267 GB

After:

$ time docker build -t dev:onbuildbase --no-cache .
[...]
Successfully built 91ead0f61278

real    3m44.476s
user    0m4.448s
sys     0m0.432s

$ docker images
REPOSITORY                       TAG                 IMAGE ID            CREATED             SIZE
dev                              usingbuildbase      91ead0f61278        53 seconds ago      2.267 GB
dockercore/buildbase             latest              3e4cb819ee01        9 minutes ago       1.822 GB

The right line between Dockerfile and Dockerfile.base is very much up for discussion. The rule of thumb for that initial proposal was to distinguish our content from third party content, under the assumption that we are more likely to update our own content throughout our pull requests.

A few more details about that new dockercore/buildbase image:

  • I pushed one up to Docker Hub for people to try it out.
  • If this gets merged, I'll enabled an Automated Build on Hub.
  • Something to keep in mind: we might have to test manually any change to Dockerfile.base.

# IMPORTANT: If the version of Go is updated, the Windows to Linux CI machines
# will need updating, to avoid errors. Ping #docker-maintainers on IRC
# with a heads-up.
ENV GO_VERSION 1.5.3
Copy link
Contributor

Choose a reason for hiding this comment

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

just want to note that we have a CI job to test against different golang versions (https://jenkins.dockerproject.org/job/docker-golang-test-master/) which will need to be updated to comply with this change.

@unclejack
Copy link
Contributor

@icecrime: It would be a good idea to have the frozen images in that base image as close as possible to the top to avoid triggering that download as much as possible. Having to download that during a build while connected to a slow network isn't fun.

@calavera
Copy link
Contributor

calavera commented Mar 1, 2016

this needs a rebase, ouch 😔

@thaJeztah
Copy link
Member

@icecrime ^^

@icecrime icecrime force-pushed the base_dockerfile branch 3 times, most recently from 3ba4919 to dc7e527 Compare March 1, 2016 22:02
@icecrime
Copy link
Contributor Author

icecrime commented Mar 1, 2016

Rebased! 👍

@tianon
Copy link
Member

tianon commented Mar 1, 2016

Do automated builds support using -f? Do we need this to live in a subdirectory somewhere for now to be able to setup an automated build on it?

@icecrime
Copy link
Contributor Author

icecrime commented Mar 1, 2016

@tianon Yes I checked beforehand :-)

image

@tianon
Copy link
Member

tianon commented Mar 1, 2016 via email

@icecrime
Copy link
Contributor Author

icecrime commented Mar 1, 2016

@tianon Oops, actually you may be right, I just assumed from the UX...

@tianon
Copy link
Member

tianon commented Mar 1, 2016 via email

@icecrime
Copy link
Contributor Author

icecrime commented Mar 1, 2016

Yeah it's just the context path 😿 Let me update that.

@icecrime icecrime force-pushed the base_dockerfile branch 2 times, most recently from c5660aa to 691c85b Compare March 1, 2016 22:57
@icecrime
Copy link
Contributor Author

icecrime commented Mar 1, 2016

Moved it back, got confirmation for team in charge of automated builds:

The ​_Dockerfile location_​ is split into a directory and a Dockerfile name. The directory becomes the build path and the Dockerfile is passed in with the equivalent of a -f using ​_docker-py_​.

So keeping it at the root will work 👍

@tianon
Copy link
Member

tianon commented Mar 1, 2016

Ah, neat; fair enough! 👍

LGTM

@tiborvass
Copy link
Contributor

LGTM

) \
&& rm -rf "$SECCOMP_PATH"
# See `Dockerfile.base`
FROM dockercore/buildbase
Copy link
Member

Choose a reason for hiding this comment

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

do we need to track the version here?

@icecrime
Copy link
Contributor Author

icecrime commented Mar 2, 2016

Let me think about @tonistiigi comment above.

Split the build Dockerfile in two, and extra the most stable pieces of
the build environment into a `dockercore/buildbase` image.

The goal is to minimize build times for the most traditional use cases,
while minimizing the dependencies to external services in our build
process.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
@icecrime
Copy link
Contributor Author

icecrime commented Mar 2, 2016

Per @tonistiigi comment: added a pull command in the Makefile to ensure that we first check for the latest dockercore/buildbase before building.

@icecrime
Copy link
Contributor Author

icecrime commented Mar 2, 2016

Ping @tianon @tiborvass @tonistiigi and all other people with "ti" in their name: PTAL!

@tiborvass
Copy link
Contributor

Better :) re-LGTM

@icecrime
Copy link
Contributor Author

icecrime commented Mar 2, 2016

Well, after discussing with @tonistiigi, I'm not sure we can merge this:

  1. If we want people to get an up-to-date build, we need to ensure that a docker pull dockercore/buildbase is done as part of the build (for example in the Makefile).
  2. If I do git checkout v1.10.0, I cannot reproduce a build unless I docker build -t dockercore/buildbase myself (and that's incompatible with the Makefile doing a docker pull).

I don't see a solution. We would need to version the dockercore/buildbase image, but that would have to be somewhat manual. 😞

@thaJeztah
Copy link
Member

Can we pull by digest?

@icecrime
Copy link
Contributor Author

icecrime commented Mar 2, 2016

@thaJeztah You don't know the digest until the automated build has run ;-)

@icecrime
Copy link
Contributor Author

icecrime commented Mar 2, 2016

Closing this 😢 It's not going to make things better...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants