-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
49 lines (33 loc) · 1.39 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
FROM centos:8.2.2004 as katapackages
ADD CentOS-8-Virt-SIG-Advanced-Virtualization.repo /etc/yum.repos.d/CentOS-8-Virt-SIG-Advanced-Virtualization.repo
ADD CentOS-8-Virt-SIG-Kata-Containers.repo /etc/yum.repos.d/CentOS-8-Virt-SIG-Kata-Containers.repo
WORKDIR /usr/src/kata-containers
#Call `dnf install` early like this, otherwise the successful transaction would
#cleanup the packages downloaded, down in this file.
RUN dnf install -y createrepo
RUN mkdir packages
RUN dnf module disable -y virt:rhel
RUN dnf install -y --downloadonly --downloaddir=/usr/src/kata-containers/packages \
qemu-kvm
#Needed as these packages are installed by default on CentOS:8.2.2004, while
#they're **not** #present on a RHCOS installation
RUN dnf reinstall -y --downloadonly --downloaddir=/usr/src/kata-containers/packages \
snappy \
lzo
RUN dnf install -y --downloadonly --downloaddir=/usr/src/kata-containers/packages \
kata-runtime \
kata-osbuilder
#We don't need kata-shim installed on OpenShift
RUN rm /usr/src/kata-containers/packages/kata-shim*.rpm
RUN ls -lR /usr/src/kata-containers/
RUN createrepo /usr/src/kata-containers/packages
COPY . .
############################
# STEP 2 build a small image
############################
FROM scratch
WORKDIR /
# Copy our static executable.
COPY --from=katapackages /usr/src/kata-containers/packages packages/
COPY packages.repo .
COPY kata-cleanup.sh .