mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-21 11:58:41 +00:00
Since the release is not yet out for ppc64le, build oras from source and use it. Fixes: #8458 Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
55 lines
1.7 KiB
Docker
55 lines
1.7 KiB
Docker
# Copyright (c) 2021 Intel Corporation
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
FROM ubuntu:20.04
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
ENV INSTALL_IN_GOPATH=false
|
|
|
|
COPY install_yq.sh /usr/bin/install_yq.sh
|
|
COPY install_oras.sh /usr/bin/install_oras.sh
|
|
|
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
|
|
# Install yq, oras, and docker
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends \
|
|
ca-certificates \
|
|
curl \
|
|
make \
|
|
git \
|
|
wget \
|
|
sudo && \
|
|
apt-get clean && rm -rf /var/lib/apt/lists/ && \
|
|
install_yq.sh && \
|
|
install_oras.sh && \
|
|
curl -fsSL https://get.docker.com -o get-docker.sh && \
|
|
if uname -m | grep -Eq 's390x|ppc64le'; then export VERSION="v20.10" && \
|
|
sed -i 's/\<docker-compose-plugin\>//g' get-docker.sh; fi && \
|
|
sh get-docker.sh
|
|
|
|
ARG IMG_USER=kata-builder
|
|
ARG UID=1000
|
|
ARG GID=1000
|
|
# gid of the docker group on the host, required for running docker in docker builds.
|
|
ARG HOST_DOCKER_GID
|
|
|
|
RUN if [ ${IMG_USER} != "root" ]; then sed -i -e "/:${GID}:/d" /etc/group; groupadd --gid=${GID} ${IMG_USER};fi
|
|
RUN if [ ${IMG_USER} != "root" ]; then adduser ${IMG_USER} --uid=${UID} --gid=${GID};fi
|
|
RUN if [ ${IMG_USER} != "root" ] && [ ! -z ${HOST_DOCKER_GID} ]; then groupadd --gid=${HOST_DOCKER_GID} docker_on_host;fi
|
|
RUN if [ ${IMG_USER} != "root" ] && [ ! -z ${HOST_DOCKER_GID} ]; then usermod -a -G docker_on_host ${IMG_USER};fi
|
|
RUN sh -c "echo '${IMG_USER} ALL=NOPASSWD: ALL' >> /etc/sudoers"
|
|
|
|
#FIXME: gcc is required as agent is build out of a container build.
|
|
RUN apt-get update && \
|
|
apt-get install --no-install-recommends -y \
|
|
build-essential \
|
|
cpio \
|
|
gcc \
|
|
unzip \
|
|
xz-utils && \
|
|
apt-get clean && rm -rf /var/lib/apt/lists
|
|
|
|
ENV USER ${IMG_USER}
|
|
USER ${IMG_USER}
|