Davlet Panech 30d4eb3566 debian: use debian snapshot repos in docker apps
- build-wheels, build-docker-images: add command line options to enable
  the use of docker filesystem cache when building
- use snapshot repo URLs defined by tools in build pods' environment to
  generate apt sources list files. These are defined in stx.conf.

TESTS
===============================
All tests were performed on Debian:
- Build wheels
- Build base image
- Build a samnple docker app that derives from the base image

Story: 2009897
Task: 45185

Depends-On: https://review.opendev.org/c/starlingx/tools/+/839396
Change-Id: I58a1ee002bb8161c492b3bcf8cd4bbcb6b4fcae4
Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
2022-04-26 11:08:30 -04:00

80 lines
2.6 KiB
Docker

# Start with an the old-ish bullseye release (11.2), then upgrade --
# to make sure packages that come pre-installed in the debian:XXX image
# are older than anything in StarlingX.
ARG RELEASE=11.2
FROM debian:${RELEASE}
ENV DEBIAN_FRONTEND=noninteractive
# Install latest ca-certificates
RUN apt-get -y update && \
apt-get -y --no-install-recommends --no-install-suggests install ca-certificates
# Disable upstream debian repos
RUN mv /etc/apt/sources.list /etc/apt/sources.list.disabled
# Install apt repos
COPY apt/debian.sources.list /etc/apt/sources.list.d/debian.list.disabled
COPY apt/stx.sources.list /etc/apt/sources.list.d/stx.list.disabled
COPY apt/stx.preferences /etc/apt/preferences.d/stx
# Enable stx repo
RUN cp /etc/apt/sources.list.d/stx.list.disabled /etc/apt/sources.list.d/stx.list
# Clean apt cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Upgrade base packages to versions in the managed repos
RUN apt-get -y update && \
apt-get -y upgrade && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# repo templates:
# /etc/apt/sources.list.d/
# debian.list.disabled - vanilla debian repos
# stx.list.disabled - starlingx binary & build repos
#
# To enable a repo list:
# cp /etc/apt/sources.list.d/$repo_list.disabled \
# /etc/apt/sources.list.d/$repo_list
#
# To disable a repo list:
# rm -f /etc/apt/sources.list.d/$repo_list
#
# By default only stx.list is enabled, which includes only the packages
# built by stx tools, and the binary packages from the curated binary
# download lists (bullseye-base.lst etc).
#
# Enabling the upstream repos ("debian.list") is dangerous because it
# may conflict with packages in stx.list.
#
RUN apt-get update -y && \
apt-get upgrade -y && \
apt-get install -y \
# FIXME: uncomment once qemu is ported to debian (starlingx/integ)
# qemu-utils \
openssh-client \
python3 \
python3-pip \
python3-wheel \
libapache2-mod-wsgi-py3 \
;
# FIXME: these packages are not required by most docker images inheriting
# from this image. However these Python modules are not buildable from
# source (ie by pip) on Debian and require patches. Install the patched
# versions as DEB packages to make sure pip dependencies in derived images
# are satisfied.
#
# A better solution would be to omit them here, but install them in each
# project that requires them; or add wheel subpackages to these DEBs.
RUN apt-get install -y \
python3-thriftpy \
python3-nss \
python-nss
# Delete apt cache
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/*