mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-07-01 06:28:11 +00:00
packaging: Add libdevmapper-dev and GNU target to agent Dockerfile
Install libdevmapper-dev and pkg-config in the agent build container so devicemapper-sys can link against libdevmapper. Add the GNU libc rustup target alongside musl since USE_DEVMAPPER forces LIBC=gnu. Forward USE_DEVMAPPER through build.sh and build-static-agent.sh. And you can compile the device mapper in kata-agent as below: ``` $ make LIBC=gnu USE_DEVMAPPER=yes ``` Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
This commit is contained in:
@@ -31,12 +31,14 @@ RUN apt-get update && \
|
||||
g++ \
|
||||
gcc \
|
||||
gnupg \
|
||||
libdevmapper-dev \
|
||||
libprotobuf-dev \
|
||||
libssl-dev \
|
||||
make \
|
||||
musl-tools \
|
||||
openssl \
|
||||
perl \
|
||||
pkg-config \
|
||||
protobuf-compiler && \
|
||||
apt-get clean && rm -rf /var/lib/apt/lists/ && \
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain ${RUST_TOOLCHAIN}
|
||||
@@ -66,4 +68,7 @@ RUN ARCH=$(uname -m); \
|
||||
"s390x") rust_arch="${ARCH}"; libc="gnu" ;; \
|
||||
*) echo "Unsupported architecture: ${ARCH}" && exit 1 ;; \
|
||||
esac; \
|
||||
rustup target add "${rust_arch}-unknown-linux-${libc}"
|
||||
rustup target add "${rust_arch}-unknown-linux-${libc}"; \
|
||||
if [ "${libc}" != "gnu" ]; then \
|
||||
rustup target add "${rust_arch}-unknown-linux-gnu"; \
|
||||
fi
|
||||
|
||||
@@ -18,10 +18,11 @@ build_agent_from_source() {
|
||||
|
||||
/usr/bin/install_libseccomp.sh /opt /opt
|
||||
|
||||
# Note: when USE_DEVMAPPER=yes the agent Makefile overrides LIBC=gnu
|
||||
cd src/agent
|
||||
# shellcheck disable=SC2154
|
||||
DESTDIR="${DESTDIR}" AGENT_POLICY="${AGENT_POLICY}" INIT_DATA="${INIT_DATA}" make
|
||||
DESTDIR="${DESTDIR}" AGENT_POLICY="${AGENT_POLICY}" INIT_DATA="${INIT_DATA}" make install
|
||||
DESTDIR="${DESTDIR}" AGENT_POLICY="${AGENT_POLICY}" INIT_DATA="${INIT_DATA}" USE_DEVMAPPER="${USE_DEVMAPPER:-no}" make
|
||||
DESTDIR="${DESTDIR}" AGENT_POLICY="${AGENT_POLICY}" INIT_DATA="${INIT_DATA}" USE_DEVMAPPER="${USE_DEVMAPPER:-no}" make install
|
||||
}
|
||||
|
||||
build_agent_from_source "$@"
|
||||
|
||||
@@ -31,6 +31,7 @@ docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \
|
||||
--env DESTDIR="${DESTDIR}" \
|
||||
--env AGENT_POLICY="${AGENT_POLICY:-no}" \
|
||||
--env INIT_DATA="${INIT_DATA:-yes}" \
|
||||
--env USE_DEVMAPPER="${USE_DEVMAPPER:-no}" \
|
||||
--env LIBSECCOMP_VERSION="${LIBSECCOMP_VERSION}" \
|
||||
--env LIBSECCOMP_URL="${LIBSECCOMP_URL}" \
|
||||
--env GPERF_VERSION="${GPERF_VERSION}" \
|
||||
|
||||
Reference in New Issue
Block a user