-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add script to build rootfs with docker locally #14
Conversation
Thanks for the PR @utzcoz. I think we can slightly improve this. Rather than starting a Docker container with a shell like in your script which requires the user have to run the DockerfileFROM debian:latest
RUN apt-get update && apt-get install -y \
binfmt-support \
debootstrap \
fakeroot \
git \
lxc \
make \
qemu \
qemu-user-static \
ubuntu-archive-keyring \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ENV MARU_WORKSPACE /var/maru
RUN mkdir -p ${MARU_WORKSPACE}
WORKDIR ${MARU_WORKSPACE}
ENTRYPOINT ["./build.sh"]
CMD ["--", "--minimal"] The build-with-docker.sh#!/bin/bash
mkdir -p out
docker build -t maruos/blueprints .
docker run --privileged --rm \
-v /var/cache:/var/cache \
-v "$(pwd)":/var/maru \
-t maruos/blueprints "$@" We use the UsageCreate the default container in Docker (specified in
Create a Debian arm64 stretch container called "stretch-container" (args will be passed to
To stop the build early you can run:
What do you think about this? I think it's clearer to read when you just need to pass in the parameters instead of entering the Docker container shell first. I am happy to merge your PR with these modifications. |
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.
Most of it looks good to me. Please see my comments on the main PR where I describe a way to use ./build-with-docker
without needing to start a separate shell.
@pdsouza I resolved problems based on your advice mostly. The |
Executing ./build-with-docker.sh or ./build-with-docker.sh -b debian -n stretch-container -- -a arm64 --minimal in blueprints directory, will build rootfs in docker locally. And the generated rootfs tar gz file will be placed in out directory. Signed-off-by: utzcoz <[email protected]>
@pdsouza I also use |
@@ -26,13 +26,17 @@ See [blueprint/debian](blueprint/debian) as the canonical example for Debian. | |||
|
|||
## Examples | |||
|
|||
Build a Debian Stretch armhf container called 'debian' (option defaults): | |||
Create the default container in Docker (specified in `Dockerfile`'s CMD): |
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.
I think we should use just ./build.sh
in the examples and then have a section where we show how you can just substitute ./build-with-docker.sh
if you would like to do the builds in a Docker container. This way, people without docker set up can still build it by installing dependencies manually, or in the case where the user is using my pdsouza/maruos-devbox container as described in the Maru Developer Guide.
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.
This is good enough to merge though; I can update the docs in another commit.
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.
LGTM. I will update the README in another commit to address my comment.
Add script to build rootfs with docker locally, when we want to build it for debug. There is a basic
Dockerfile
and building script , I just add script to build and run docker environment for rootfs building. Executing ./build-with-docker.sh in blueprints directory, and executing ./build.sh with parameter following document to build rootfs manually, and the rootfs tar gz will generated in out directory.Signed-off-by: utzcoz [email protected]