forked from kata-containers/kata-containers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
68 lines (64 loc) · 2.12 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
# Copyright (c) 2022 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
from ubuntu:20.04
ARG DEBIAN_FRONTEND=noninteractive
ARG cryptsetup_repo=${cryptsetup_repo}
ARG cryptsetup_version=${cryptsetup_version}
ARG lvm2_repo=${lvm2_repo}
ARG lvm2_version=${lvm2_version}
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV TZ=UTC
RUN apt-get update &&\
apt-get --no-install-recommends install -y software-properties-common &&\
apt-get update && apt-get upgrade -y && \
apt-get --no-install-recommends install -y \
apt-utils \
asciidoctor \
autoconf \
autopoint \
automake \
busybox-static \
ca-certificates \
curl \
gcc \
gettext \
git \
libaio-dev \
libblkid-dev \
libselinux1-dev \
libtool \
libpopt-dev \
libjson-c-dev \
libssl-dev \
make \
ninja-build \
pkg-config \
uuid-dev \
libseccomp-dev \
libseccomp2 \
zlib1g-dev &&\
apt-get clean && rm -rf /var/lib/apt/lists/ && \
build_root=$(mktemp -d) && \
pushd ${build_root} && \
echo "Build ${lvm2_repo} version: ${lvm2_version}" && \
git clone --depth 1 --branch "${lvm2_version}" "${lvm2_repo}" lvm2 && \
pushd lvm2 && \
./configure --enable-static_link --disable-selinux && \
make && make install && \
cp ./libdm/libdevmapper.pc /usr/lib/pkgconfig/devmapper.pc && \
popd && \
echo "Build ${cryptsetup_repo} version: ${cryptsetup_version}" && \
git clone --depth 1 --branch "${cryptsetup_version}" "${cryptsetup_repo}" cryptsetup && \
pushd cryptsetup && \
./autogen.sh && \
./configure --enable-static --enable-static-cryptsetup --disable-udev --disable-external-tokens --disable-ssh-token && \
make && make install && \
strip /usr/sbin/veritysetup.static && \
popd && \
echo "Build gen_init_cpio tool" && \
curl -LO https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/usr/gen_init_cpio.c && \
make gen_init_cpio && mv gen_init_cpio /usr/sbin/ && rm -f gen_init_cpio.c && \
popd && \
rm -rf ${build_root}
COPY init.sh /usr/sbin/init.sh