mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-04 11:06:21 +00:00
ci: tools no sudo
Build tools without sudo docker this is not needed. This is part 7 of N Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
This commit is contained in:
parent
a7931115a0
commit
dd04d26cb0
@ -6,7 +6,18 @@ FROM alpine:3.18
|
|||||||
ARG GO_TOOLCHAIN
|
ARG GO_TOOLCHAIN
|
||||||
ARG RUST_TOOLCHAIN
|
ARG RUST_TOOLCHAIN
|
||||||
|
|
||||||
|
ENV RUSTUP_HOME="/opt/rustup"
|
||||||
|
ENV CARGO_HOME="/opt/cargo"
|
||||||
|
ENV PATH="/opt/cargo/bin/:${PATH}"
|
||||||
|
|
||||||
|
ENV LIBC="musl"
|
||||||
|
ENV LIBSECCOMP_LINK_TYPE=static
|
||||||
|
ENV LIBSECCOMP_LIB_PATH=/usr/lib
|
||||||
|
|
||||||
SHELL ["/bin/ash", "-o", "pipefail", "-c"]
|
SHELL ["/bin/ash", "-o", "pipefail", "-c"]
|
||||||
|
|
||||||
|
RUN mkdir ${RUSTUP_HOME} ${CARGO_HOME} && chmod -R a+rwX ${RUSTUP_HOME} ${CARGO_HOME}
|
||||||
|
|
||||||
RUN apk --no-cache add \
|
RUN apk --no-cache add \
|
||||||
bash \
|
bash \
|
||||||
cmake \
|
cmake \
|
||||||
|
@ -26,10 +26,9 @@ build_tool_from_source() {
|
|||||||
tool=${1}
|
tool=${1}
|
||||||
|
|
||||||
echo "build ${tool} from source"
|
echo "build ${tool} from source"
|
||||||
init_env
|
|
||||||
|
|
||||||
cd src/tools/${tool}
|
cd "src/tools/${tool}"
|
||||||
make
|
make
|
||||||
}
|
}
|
||||||
|
|
||||||
build_tool_from_source $@
|
build_tool_from_source "$@"
|
||||||
|
@ -18,14 +18,15 @@ tool="${1}"
|
|||||||
container_image="${TOOLS_CONTAINER_BUILDER:-$(get_tools_image_name)}"
|
container_image="${TOOLS_CONTAINER_BUILDER:-$(get_tools_image_name)}"
|
||||||
[ "${CROSS_BUILD}" == "true" ] && container_image="${container_image}-cross-build"
|
[ "${CROSS_BUILD}" == "true" ] && container_image="${container_image}-cross-build"
|
||||||
|
|
||||||
sudo docker pull ${container_image} || \
|
docker pull ${container_image} || \
|
||||||
(sudo docker $BUILDX build $PLATFORM \
|
(docker $BUILDX build $PLATFORM \
|
||||||
--build-arg RUST_TOOLCHAIN="$(get_from_kata_deps "languages.rust.meta.newest-version")" \
|
--build-arg RUST_TOOLCHAIN="$(get_from_kata_deps "languages.rust.meta.newest-version")" \
|
||||||
-t "${container_image}" "${script_dir}" && \
|
-t "${container_image}" "${script_dir}" && \
|
||||||
# No-op unless PUSH_TO_REGISTRY is exported as "yes"
|
# No-op unless PUSH_TO_REGISTRY is exported as "yes"
|
||||||
push_to_registry "${container_image}")
|
push_to_registry "${container_image}")
|
||||||
|
|
||||||
sudo docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \
|
docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \
|
||||||
-w "${repo_root_dir}" \
|
-w "${repo_root_dir}" \
|
||||||
|
--user "$(id -u)":"$(id -g)" \
|
||||||
"${container_image}" \
|
"${container_image}" \
|
||||||
bash -c "${tools_builder} ${tool}"
|
bash -c "${tools_builder} ${tool}"
|
||||||
|
Loading…
Reference in New Issue
Block a user