tools/stx/dockerfiles/stx-lat-tool.Dockerfile
Leonardo Fagundes Luz Serrano d5eec5ba18 Add 7z cmd support to LAT container
This utility can extract files from ISOs
and is used to create the pre-patched ISO
in the patch-iso-debian script.

Test Plan:
pass - build LAT container
pass - confirm 7z is available in LAT

Story: 2011098
Task: 50849

Change-Id: Iefc0aeca3c70f06def3e5d6e943dae74fe20ce25
Signed-off-by: Leonardo Fagundes Luz Serrano <Leonardo.FagundesLuzSerrano@windriver.com>
2024-08-15 18:02:44 -03:00

96 lines
3.3 KiB
Docker

# Copyright (c) 2021 Wind River Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM debian:bullseye
MAINTAINER Chen Qi <Qi.Chen@windriver.com>
ARG STX_MIRROR_URL=https://mirror.starlingx.windriver.com/mirror
ARG LAT_BINARY_RESOURCE_PATH=${STX_MIRROR_URL}/lat-sdk/lat-sdk-20231206
# Update certificates
RUN apt-get -y update && apt-get -y install --no-install-recommends ca-certificates && update-ca-certificates
# Install necessary packages
RUN apt-get -y update && apt-get --no-install-recommends -y install \
openssh-client \
python3 \
python3-pip \
xz-utils \
file \
bzip2 \
procps \
tini \
wget \
locales-all \
python3-yaml \
rsync \
cpio \
vim \
&& \
apt-get clean && \
mkdir -p /opt/LAT/SDK && \
pip3 install pycryptodomex requests_toolbelt
# Packages for pre-patched iso creation support
RUN apt-get -y install \
isomd5sum \
syslinux-utils \
bubblewrap \
git \
python3-apt \
python3-gi \
python3-gi-cairo \
python3-systemd \
gir1.2-ostree-1.0 \
reprepro \
dosfstools \
xfsprogs \
debos \
mmdebstrap \
p7zip-full \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
pip3 install git+https://opendev.org/starlingx/apt-ostree@master
# Insert pubkey of the package repository
COPY stx/toCOPY/builder/pubkey.rsa /opt/LAT/
# Prepare executables
COPY stx/toCOPY/lat-tool/lat/ /opt/LAT/lat
# Download & install LAT SDK.
RUN wget --quiet ${LAT_BINARY_RESOURCE_PATH}/lat-sdk.sh --output-document=/opt/LAT/AppSDK.sh && \
chmod +x /opt/LAT/AppSDK.sh && \
/opt/LAT/AppSDK.sh -d /opt/LAT/SDK -y && \
rm -f /opt/LAT/AppSDK.sh
# Fix: Use Debian CDN address for geo-frendly servers
RUN sed -i 's/ftp.cn.debian.org/deb.debian.org/g' /opt/LAT/SDK/sysroots/x86_64-wrlinuxsdk-linux/usr/lib/python3.10/site-packages/genimage/debian_constant.py
# Fix: Align DEFAULT_INITRD_NAME with our custom names
RUN sed -i 's/debian-initramfs-ostree-image/starlingx-initramfs-ostree-image/g' /opt/LAT/SDK/sysroots/x86_64-wrlinuxsdk-linux/usr/lib/python3.10/site-packages/genimage/debian_constant.py
# Fix: Align kernel with custom starlingx kernel
RUN sed -i 's/linux-image-amd64/linux-image-stx-amd64/g' /opt/LAT/SDK/sysroots/x86_64-wrlinuxsdk-linux/usr/lib/python3.10/site-packages/genimage/debian_constant.py
RUN sed -i 's/Wind River Linux Graphics development .* ostree/StarlingX ostree/g' /opt/LAT/SDK/sysroots/corei7-64-wrs-linux/boot/efi/EFI/BOOT/grub.cfg
# Add vimrc
COPY stx/toCOPY/common/vimrc.local /etc/vim/vimrc.local
RUN chmod 0644 /etc/vim/vimrc.local
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["/opt/LAT/lat/latd"]