-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker build support #413
base: master
Are you sure you want to change the base?
docker build support #413
Conversation
@@ -29,14 +29,15 @@ def create_configuration_file(args): | |||
config_path = os.path.join('steps', 'bootstrap.cfg') | |||
with open(config_path, "w", encoding="utf_8") as config: | |||
config.write(f"FORCE_TIMESTAMPS={args.force_timestamps}\n") | |||
config.write(f"CHROOT={args.chroot or args.bwrap}\n") | |||
config.write(f"CHROOT={args.chroot or args.bwrap or args.docker}\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not something that needs changing in this PR, but in the future, we might want to rename this variable to something more descriptive, like USERSPACE_ONLY (especially if/when I go through with adding the WSL bootstrap mode I'm planning).
if args.docker: | ||
args.external_sources = True | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this?
generator.prepare(target, using_kernel=False) | ||
arch = stage0_arch_map.get(args.arch, args.arch) | ||
init = os.path.join(os.sep, 'bootstrap-seeds', 'POSIX', arch, 'kaem-optional-seed') | ||
print(generator.target_dir, init) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leftover debug print
steps/improve/finalize_fhs.sh
Outdated
# Add /etc/resolv.conf | ||
echo 'nameserver 1.1.1.1' > /etc/resolv.conf | ||
echo 'nameserver 1.1.1.1' > /etc/resolv.conf.head | ||
if [ "${EXTERNAL_SOURCES}" = "False" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, is this the only way to do this? Wouldn't it work to have a ${DOCKER} to disable writing resolv.conf, and still retain the ability to run without predownloading everything on the host?
|
||
FROM scratch as build | ||
ADD target/ / | ||
RUN ["/bootstrap-seeds/POSIX/x86/kaem-optional-seed"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pass "arch" from bootstrap() here, if possible, rather than hardcoding "x86".
|
||
FROM build as install | ||
ENV PATH=/bin:/usr/sbin:/usr/bin | ||
RUN set -eux; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the inclusion of the "x" flag intentional here, or just leftover from debugging?
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
FROM scratch as build | ||
ADD target/ / |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pass target directory from bootstrap() here, if possible, rather than hardcoding "target".
echo 'nameserver 1.1.1.1' > /etc/resolv.conf | ||
fi | ||
if [ ! -e "/etc/resolv.conf/head" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: resolv.conf.head
|
||
# /etc/passwd -- taken from LFS | ||
if [ ! -e "/etc/passwd" ]; then | ||
cat > /etc/passwd << "EOF" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this conflict with later steps?
Support building live-bootstrap as a deterministic docker image.
An image can be exported after build with:
Expected hash as of this PR is: