diff --git a/build.py b/build.py index 9c6facf..3c5fd7d 100755 --- a/build.py +++ b/build.py @@ -365,6 +365,14 @@ class DockerBuilder: run(["buildah", "from", "--arch", arch, "--name", new, distroless.from_]) if packages := distroless.builder_install_packages: + tasks = self.tasks.get(self.branch, image) + if tasks: + if arch == "386": + apt_repo_add = ["linux32", "apt-repo", "add"] + else: + apt_repo_add = ["apt-repo", "add"] + for task in tasks: + run(["buildah", "run", builder] + apt_repo_add + [task]) run(["buildah", "run", builder, "apt-get", "update"]) run( ["buildah", "run", builder, "apt-get", "reinstall", "-y"] + packages diff --git a/org/alt/distroless-builder/Dockerfile.template b/org/alt/distroless-builder/Dockerfile.template index 6199450..ebfc620 100644 --- a/org/alt/distroless-builder/Dockerfile.template +++ b/org/alt/distroless-builder/Dockerfile.template @@ -4,7 +4,7 @@ MAINTAINER alt-cloud RUN echo %_excludedocs 1 >> /etc/rpm/macros RUN rpm -qalds | awk '/^normal/{print $2}' | xargs rm -rf -{{ install_pakages("python3", "glibc-utils") }} +{{ install_pakages("python3", "glibc-utils", "apt-repo") }} WORKDIR /usr/src/distroless RUN mkdir file-lists RUN useradd -m nonroot