-
Notifications
You must be signed in to change notification settings - Fork 18.9k
Dockerfile: install criu from binary repo #41739
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,23 +23,10 @@ ARG DEBIAN_FRONTEND | |
| # Install dependency packages specific to criu | ||
| RUN --mount=type=cache,sharing=locked,id=moby-criu-aptlib,target=/var/lib/apt \ | ||
| --mount=type=cache,sharing=locked,id=moby-criu-aptcache,target=/var/cache/apt \ | ||
| apt-get update && apt-get install -y --no-install-recommends \ | ||
| libcap-dev \ | ||
| libnet-dev \ | ||
| libnl-3-dev \ | ||
| libprotobuf-c-dev \ | ||
| libprotobuf-dev \ | ||
| protobuf-c-compiler \ | ||
| protobuf-compiler \ | ||
| python-protobuf | ||
|
|
||
| # Install CRIU for checkpoint/restore support | ||
| ARG CRIU_VERSION=3.14 | ||
| RUN mkdir -p /usr/src/criu \ | ||
| && curl -sSL https://github.com/checkpoint-restore/criu/archive/v${CRIU_VERSION}.tar.gz | tar -C /usr/src/criu/ -xz --strip-components=1 \ | ||
| && cd /usr/src/criu \ | ||
| && make \ | ||
| && make PREFIX=/build/ install-criu | ||
| echo 'deb https://download.opensuse.org/repositories/devel:/tools:/criu/Debian_10/ /' > /etc/apt/sources.list.d/criu.list \ | ||
| && curl -fsSL https://download.opensuse.org/repositories/devel:/tools:/criu/Debian_10/Release.key | apt-key add - \ | ||
| && apt-get update \ | ||
| && apt-get install -y --no-install-recommends criu | ||
|
|
||
| FROM base AS registry | ||
| WORKDIR /go/src/github.com/docker/distribution | ||
|
|
@@ -300,7 +287,7 @@ COPY --from=swagger /build/ /usr/local/bin/ | |
| COPY --from=tomlv /build/ /usr/local/bin/ | ||
| COPY --from=tini /build/ /usr/local/bin/ | ||
| COPY --from=registry /build/ /usr/local/bin/ | ||
| COPY --from=criu /build/ /usr/local/ | ||
| COPY --from=criu /usr/sbin/criu /usr/local/bin | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could do something cute like
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given that we don't run the intermediate
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can literally have images in ghcr or hub for all of these things we currently build in the Dockerfile..
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But then we'd have to maintain (multi-arch) images for each of those stages?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't be terribly difficult. |
||
| COPY --from=vndr /build/ /usr/local/bin/ | ||
| COPY --from=gotestsum /build/ /usr/local/bin/ | ||
| COPY --from=golangci_lint /build/ /usr/local/bin/ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somewhat confusing the the "debian" packages are on a "opensuse" repository 😅
Do we need to replace the use of
apt-key addhere @tianon ? (recalling I was in the middle of reviewing docker/docs#11990)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't immediately "need" to, but we will soon and definitely should.
If we don't actually care about the provenance, we can just download the file straight to
/etc/apt/trusted.gpg.d/something.gpg.asc(probablycriu.gpg.asc) and it will work in this instance (and be at least as secure as piping toapt-key add -...)Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I gave it a quick try, and that works; tried to use
ADDinstead of curl (so that cache would be invalidated would the key change), but ran into a bug, LOL (opened moby/buildkit#2114)Let me know what you think @tianon @kolyshkin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, let me add
install -D /usr/sbin/criu /build/so that we can revert the change to theCOPY --fromas well