Allow tasks in distroless images
This commit is contained in:
parent
dad90431e3
commit
d7f23121aa
8
build.py
8
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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user