-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
81 lines (67 loc) · 2.36 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
FROM debian:buster as nested-kata-build-assistant
RUN apt-get update \
&& apt-get install --yes --no-install-recommends \
apt-transport-https \
bc \
bison \
bridge-utils \
btrfs-progs \
build-essential \
ca-certificates \
cpio \
curl \
flex \
gnupg2 \
kmod \
libelf-dev \
libncurses5-dev \
libssl-dev \
lzop \
openssh-client \
openssh-server \
software-properties-common \
systemd \
xz-utils
COPY ./assets/etc/apt/sources.list /etc/apt/sources.list
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
RUN add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable"
RUN apt-get update \
&& apt-get install --yes --no-install-recommends \
containerd.io \
docker-ce \
docker-ce-cli
FROM nested-kata-build-assistant as kata
ENV ARCH=x86_64
ENV KATA_BRANCH=master
ENV VERSION_ID=10
RUN echo "deb http://download.opensuse.org/repositories/home:/katacontainers:/releases:/${ARCH}:/${KATA_BRANCH}/Debian_${VERSION_ID}/ /" \
> /etc/apt/sources.list.d/kata-containers.list
RUN curl -sL http://download.opensuse.org/repositories/home:/katacontainers:/releases:/${ARCH}:/${KATA_BRANCH}/Debian_${VERSION_ID}/Release.key \
| apt-key add -
RUN apt-get update \
&& apt-get install --yes --no-install-recommends \
kata-proxy \
kata-runtime \
kata-shim
RUN systemctl enable ssh
RUN systemctl enable docker
RUN systemctl mask systemd-firstboot
RUN systemctl mask getty.slice
RUN systemctl mask getty.target
RUN mkdir -p /etc/docker
RUN echo '{ "runtimes": { "kata": { "path": "/usr/bin/kata-runtime" } } }' > /etc/docker/daemon.json
RUN apt-get install --yes --no-install-recommends golang git wget
RUN go get -d -u github.com/kata-containers/packaging || true
WORKDIR /root/go/src/github.com/kata-containers/packaging/kernel
RUN wget -q "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.4.tar.xz" \
&& tar xf linux-5.4.tar.xz
COPY ./assets/kernel.config linux-5.4/.config
RUN ./build-kernel.sh -c linux-5.4/.config -k linux-5.4/ setup \
&& ./build-kernel.sh -c linux-5.4/.config -k linux-5.4/ build \
&& ./build-kernel.sh -c linux-5.4/.config -k linux-5.4/ install
COPY --chown=root:root ./assets/root/.ssh/ /root/.ssh/
COPY --chown=root:root ./assets/setup.sh /setup.sh
CMD ["/lib/systemd/systemd"]