Skip to content
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

removing builder-build from build and adding instructions how to build the builder #5

Merged
merged 1 commit into from
Jun 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this rename necessary?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docker wants to have a Dockerfile. Podman can work with both.

File renamed without changes.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,15 @@ In addition to the above components, your configuration directory must include t
If you're new to configuring the Builder, you can find a minimal example config directory at [gardenlinux/builder_example](https://github.com/gardenlinux/builder_example). For a more comprehensive example, refer to the main [gardenlinux](https://github.com/gardenlinux/gardenlinux) repository.

Feel free to explore these examples to gain a better understanding of how to effectively structure your own config directory.


## Contribute

If you like to modify the *Garden Linux Builder*, make your changes and create a new builder container by simply building the root folder with docker or podman:

sudo podman build -t localhost/builder .

# or

docker build -t localhost/builder .

5 changes: 0 additions & 5 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ container_mount_opts=(
-v "$PWD/$target_dir:/builder/.build"
)

if [ "$container_image" = localhost/builder ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part of the build script is intended to speed up local dev / testing, by allowing to automatically rebuild the builder if any local changes were made.
It works if instead of downloading a release build script and placing it in the config directory, you instead sym link to the script inside a local copy of the builder repo.
We should not remove this

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably document how this local dev / testing setup works though 😅

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but how do I use a locally built builder in a separate repo, that holds my features?
When I set the container image in the other repo to localhost/builder it tries to build the builder. Instead, it should use the builder that I have built before using docker build -t localhost/builder .

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to build the builder in the same repo that hold my features. I want to have it separated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is to use a symlink to the build script inside the builder repo instead of a copy of the build script when doing local dev on the builder. That way the builder and the features are still separated, but the builder automatically detects that it is running in local dev mode and rebuilds itself iff necessary.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand. Can you plz provide an example?

dir="$(dirname -- "$(realpath -- "${BASH_SOURCE[0]}")")"
"$container_engine" build -t "$container_image" "$dir"
fi

repo="$(./get_repo)"
commit="$(./get_commit)"
timestamp="$(./get_timestamp)"
Expand Down