Skip to content
Snippets Groups Projects
Commit 8213e56c authored by Simon McVittie's avatar Simon McVittie
Browse files

Generate a Dockerfile alongside the sysroot tarball

parent 051de6ba
No related branches found
No related tags found
No related merge requests found
FROM scratch
ADD @sysroot_tarball@ /
RUN \
set -e; \
rm -rf /var/lib/apt/lists/*; \
mkdir -p /run/systemd; \
echo 'docker' > /run/systemd/container; \
:
CMD ["/bin/bash"]
# vim:set sw=4 sts=4 et:
......@@ -848,10 +848,33 @@ class Builder:
subprocess.check_call(argv)
if sdk:
if sysroot_tarball is not None:
if sysroot_prefix is not None:
assert sysroot_tarball is not None
output = os.path.join(self.build_area, sysroot_tarball)
os.rename(output + '.new', output)
output = os.path.join(
self.build_area, sysroot_prefix + '.Dockerfile')
with open(
os.path.join(
os.path.dirname(__file__), 'flatdeb',
'Dockerfile.in'),
'r',
encoding='utf-8',
) as reader:
content = reader.read()
content = content.replace(
'@sysroot_tarball@', sysroot_tarball)
with open(
output + '.new', 'w', encoding='utf-8'
) as writer:
writer.write(content)
os.rename(output + '.new', output)
logger.info('Committing %s to OSTree', sources_tarball)
output = os.path.join(self.build_area, sources_tarball)
os.rename(output + '.new', output)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment