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

KIC: Install buildkit package for use with containerd #9646

Merged
merged 1 commit into from
Nov 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions deploy/kicbase/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
# for a kubernetes node image, it doesn't contain much we don't need
FROM ubuntu:focal-20200925

ARG BUILDKIT_VERSION="v0.7.2"

Choose a reason for hiding this comment

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

nit: I think it would help readability to run this line right before we install buildkit, so it's easy to see everything at once


# copy in static files (configs, scripts)
COPY 10-network-security.conf /etc/sysctl.d/10-network-security.conf
COPY 11-tcp-mtu-probing.conf /etc/sysctl.d/11-tcp-mtu-probing.conf
Expand Down Expand Up @@ -106,6 +108,17 @@ RUN sh -c "echo 'deb https://download.docker.com/linux/ubuntu focal stable' > /e
apt-key add - < docker.key && \
clean-install docker-ce docker-ce-cli containerd.io

# install buildkit
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you update the comment to mention why we're pulling from this repo as opposed to an official one? It seems suspect.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There is no official one yet, and I haven't made the request yet...

It's built from https://github.com/afbjorklund/buildkit/tree/debian

Basically I copied the ubuntu packaging for "runc", for "buildkit"

Probably should upload the .dsc and the tarballs to bintray.com ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

See also #9552

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Made a similar hack for podman

Copy link
Member

Choose a reason for hiding this comment

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

Does it really need to be dpkg?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It doesn't have to be, no. We just preferred using regular system packages, and getting all the software from one place.
But since we moved from ubuntu.com to docker.com for runc/containerd/dockerd - we can get buildkit from github.com

At least until there is an official package available.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Adopted the containerd installation script from kind, and adopted to minor quirks in the buildkit release.

RUN export ARCH=$(dpkg --print-architecture | sed 's/ppc64el/ppc64le/' | sed 's/armhf/arm-v7/') \
&& echo "Installing buildkit ..." \
&& export BUILDKIT_BASE_URL="https://github.com/moby/buildkit/releases/download/${BUILDKIT_VERSION}" \
&& curl -sSL --retry 5 --output /tmp/buildkit.tgz "${BUILDKIT_BASE_URL}/buildkit-${BUILDKIT_VERSION}.linux-${ARCH}.tar.gz" \
&& tar -C /usr/local -xzvf /tmp/buildkit.tgz \
&& rm -rf /tmp/buildkit.tgz \
&& chmod 755 /usr/local/bin/buildctl \

Choose a reason for hiding this comment

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

just to shorten this, we could chmod all three files in one command:

chmod 755 /usr/local/bin/build*

&& chmod 755 /usr/local/bin/buildkit-runc \
&& chmod 755 /usr/local/bin/buildkitd

# Install cri-o/podman dependencies:
RUN sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list" && \
curl -LO https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_20.04/Release.key && \
Expand Down