2023-02-05 21:06:50 +01:00
|
|
|
#
|
|
|
|
# kas - setup tool for bitbake based projects
|
|
|
|
#
|
|
|
|
# Copyright (c) Siemens AG, 2017-2023
|
|
|
|
#
|
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
# of this software and associated documentation files (the "Software"), to deal
|
|
|
|
# in the Software without restriction, including without limitation the rights
|
|
|
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
# copies of the Software, and to permit persons to whom the Software is
|
|
|
|
# furnished to do so, subject to the following conditions:
|
|
|
|
#
|
|
|
|
# The above copyright notice and this permission notice shall be
|
|
|
|
# included in all copies or substantial portions of the Software.
|
|
|
|
#
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
# SOFTWARE.
|
2017-06-14 13:36:37 +02:00
|
|
|
|
2022-08-26 14:34:37 +02:00
|
|
|
FROM debian:bullseye-slim as kas-base
|
2018-07-17 21:56:15 +02:00
|
|
|
|
2021-01-02 19:49:39 +01:00
|
|
|
ARG TARGETPLATFORM
|
2021-01-02 15:48:05 +01:00
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
2022-05-16 08:39:32 +02:00
|
|
|
ENV LANG=en_US.utf8
|
2021-11-17 07:25:02 +01:00
|
|
|
RUN apt-get update && \
|
2018-07-17 21:56:15 +02:00
|
|
|
apt-get install -y locales && \
|
2022-05-16 08:39:32 +02:00
|
|
|
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 && \
|
|
|
|
apt-get install --no-install-recommends -y \
|
2022-08-26 14:34:37 +02:00
|
|
|
python3-pip python3-setuptools python3-wheel python3-yaml python3-distro python3-jsonschema python3-newt \
|
2023-01-23 23:20:28 +01:00
|
|
|
gosu lsb-release file vim less procps tree tar bzip2 zstd pigz lz4 unzip tmux libncurses-dev \
|
2022-08-26 14:34:37 +02:00
|
|
|
git-lfs mercurial iproute2 ssh-client telnet curl rsync gnupg awscli sudo \
|
|
|
|
socat bash-completion && \
|
2017-06-20 07:54:03 +02:00
|
|
|
apt-get clean && \
|
|
|
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
|
|
|
2017-06-14 13:36:37 +02:00
|
|
|
COPY . /kas
|
2021-10-29 12:51:10 +02:00
|
|
|
RUN chmod -R o-w /kas
|
|
|
|
|
2021-07-18 16:39:06 +02:00
|
|
|
RUN pip3 --proxy=$https_proxy install --no-deps kconfiglib && \
|
2022-10-14 10:07:38 +02:00
|
|
|
pip3 --proxy=$https_proxy install --no-deps /kas && kas --version && \
|
|
|
|
rm -rf $(pip3 cache dir)
|
2017-06-14 13:36:37 +02:00
|
|
|
|
2021-10-29 12:25:25 +02:00
|
|
|
RUN ln -s /kas/contrib/oe-git-proxy /usr/bin/
|
|
|
|
ENV GIT_PROXY_COMMAND="oe-git-proxy" \
|
|
|
|
NO_PROXY="*"
|
|
|
|
|
2021-04-26 17:01:59 +02:00
|
|
|
RUN echo "builder ALL=NOPASSWD: ALL" > /etc/sudoers.d/builder-nopasswd && \
|
|
|
|
chmod 660 /etc/sudoers.d/builder-nopasswd
|
|
|
|
|
|
|
|
RUN echo "Defaults env_keep += \"ftp_proxy http_proxy https_proxy no_proxy\"" \
|
|
|
|
> /etc/sudoers.d/env_keep && chmod 660 /etc/sudoers.d/env_keep
|
|
|
|
|
2023-02-05 21:02:07 +01:00
|
|
|
RUN useradd builder --user-group --create-home --home-dir /builder
|
|
|
|
|
2020-09-28 09:02:12 +02:00
|
|
|
ENTRYPOINT ["/kas/container-entrypoint"]
|
2022-08-26 14:34:37 +02:00
|
|
|
|
2023-02-05 21:06:50 +01:00
|
|
|
#
|
|
|
|
# kas-isar image
|
|
|
|
#
|
|
|
|
|
2022-08-26 14:34:37 +02:00
|
|
|
FROM kas-base as kas-isar
|
|
|
|
|
2022-10-14 10:07:37 +02:00
|
|
|
# The install package list are actually taking 1:1 from their documentation,
|
|
|
|
# so there some packages that can already installed by other downstream layers.
|
|
|
|
# This will not change any image sizes on all the layers in use.
|
2022-08-26 14:34:37 +02:00
|
|
|
ENV LC_ALL=en_US.UTF-8
|
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y -f --no-install-recommends \
|
|
|
|
binfmt-support debootstrap dosfstools dpkg-dev gettext-base git \
|
|
|
|
mtools parted python3 quilt qemu-user-static reprepro sudo \
|
|
|
|
git-buildpackage pristine-tar sbuild schroot \
|
|
|
|
umoci skopeo && \
|
|
|
|
apt-get clean && \
|
2023-02-05 20:56:06 +01:00
|
|
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
|
2023-02-05 21:02:07 +01:00
|
|
|
sbuild-adduser builder && \
|
2023-02-05 20:56:06 +01:00
|
|
|
sed -i 's|# kas-isar: ||g' /kas/container-entrypoint
|
2022-08-26 14:34:37 +02:00
|
|
|
|
2023-02-05 21:02:07 +01:00
|
|
|
USER builder
|
|
|
|
|
2023-02-05 21:06:50 +01:00
|
|
|
#
|
|
|
|
# kas image
|
|
|
|
#
|
|
|
|
|
2022-08-26 14:34:37 +02:00
|
|
|
FROM kas-base as kas
|
|
|
|
|
2022-10-14 10:07:37 +02:00
|
|
|
# The install package list are actually taking 1:1 from their documentation,
|
|
|
|
# so there some packages that can already installed by other downstream layers.
|
|
|
|
# This will not change any image sizes on all the layers in use.
|
2022-08-26 14:34:37 +02:00
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install --no-install-recommends -y \
|
|
|
|
gawk wget git diffstat unzip texinfo \
|
|
|
|
gcc build-essential chrpath socat cpio python3 python3-pip python3-pexpect \
|
|
|
|
xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev \
|
|
|
|
pylint3 xterm python3-subunit mesa-common-dev zstd liblz4-tool && \
|
|
|
|
if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
|
|
|
|
apt-get install --no-install-recommends -y gcc-multilib g++-multilib; \
|
|
|
|
fi && \
|
|
|
|
apt-get clean && \
|
|
|
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
2023-02-05 21:02:07 +01:00
|
|
|
|
|
|
|
USER builder
|