Updates the Dockerfile to use multi-stage#35100
Conversation
Dockerfile
Outdated
There was a problem hiding this comment.
Looks like a bad rebase or so; I see && apt-get install -y curl at line 12 below, which probably had to be here
Dockerfile
Outdated
There was a problem hiding this comment.
Can we make this Dockerfile to support other archs
There was a problem hiding this comment.
Can we do it separately? I'd love to but I'm sure there must be other things that need to be done.
Also I'm not sure if the base images have multi-arch even though they provide manifest lists now?
Dockerfile
Outdated
There was a problem hiding this comment.
How does it relate to golang?
There was a problem hiding this comment.
The frozen image script is using go env.
This could be worked around, but I'd rather leave it as is for now.
Dockerfile
Outdated
There was a problem hiding this comment.
Can we just use docker.io/library/golang? (cc @thaJeztah @justincormack )
There was a problem hiding this comment.
I don't know why we aren't using the golang image... it's come up before, just can't remember the details.
Dockerfile
Outdated
|
ping @cpuguy83 ^^ |
793d9be to
250c99a
Compare
|
I updated this... but of course our builders are still out of date. |
There was a problem hiding this comment.
Why not just use git -C here instead of doing a cd and then a git command?
There was a problem hiding this comment.
These are copied from the old install-binaries.sh file. I'd prefer to optimize them separately.
There was a problem hiding this comment.
Same note here about git -C
Dockerfile
Outdated
There was a problem hiding this comment.
&& apt-get install -y curl
bad rebase?
|
ping ^^ @cpuguy83 |
|
I was also wondering if we should pin the Go version for the various upstream binaries (e.g., what if upstream RunC has only been tested/verified with Go 1.8?) |
|
We are also still waiting on Jenkins to be updated. There are a few issues on the nodes being tracked. |
250c99a to
d017f2a
Compare
|
Hmf looks like this Jenkins isn’t update yet 😞 |
|
Binary installs were split off in #36336 |
63aaf8f to
2a0786c
Compare
tonistiigi
left a comment
There was a problem hiding this comment.
parallelization preview:
> docker build .
...
real 9m15.516s
user 0m2.052s
sys 0m0.880s
> buildctl build --frontend dockerfile.v0 --local context=. --local dockerfile=.
[+] Building 268.2s (61/61) FINISHED
...
real 4m28.229s
user 0m6.208s
sys 0m3.696s
Rebuild with cache for docker build --pull . is 9-10sec vs ~1-2 sec. in buildkit (almost all that time is spent verifying that the base images have not changed in registry as there is no tag cache).
Dockerfile
Outdated
There was a problem hiding this comment.
I'd love if these versions would be defined in the top of the Dockerfile now so you could do things like docker build --build-arg RUNC_COMMIT=master .
There was a problem hiding this comment.
I agree. Can we get this change in and then start adding in new features?
|
janky tests are ok, the binary cross got "cut" because the build ran for too long |
Signed-off-by: Brian Goff <cpuguy83@gmail.com> Signed-off-by: Vincent Demeester <vincent@sbr.pm>
fe9d0ab to
d539038
Compare
|
Created follow-up issues for tracking:
|
|
|
||
| FROM debian:stretch | ||
|
|
||
| FROM buildpack-deps:stretch AS base |
There was a problem hiding this comment.
Can we start with golang image (which is essentially stretch with golang installed)?
There was a problem hiding this comment.
cc @tianon
I know this was attempted in the past, I don't recall why we didn't do it.
There was a problem hiding this comment.
If I recall correctly, at the time we were still using utilities that Ubuntu had better packaging for than Debian, so given we're on Debian now, it's likely OK. 👍
Posting this up here for others to contribute to.
IIRC the CI dockerd instances don't support multi-stage builds yet.
I'm not sure if this broke CRIU or not (I haven't tried to use CRIU in dind before and it definitely doesn't work with this PR).
Everything else seems to work.
I find this to be a little slower (haven't measured, not much but if you are paying attention you'd notice) to run the build from a full cache than the monolithic Dockerfile, but it makes it MUCH faster for individual changes to the dockerfile not requiring to rebuild basically the whole thing.