-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Better support distrobox (#160)
We will now have a dedicated alpine based `distrobox` image. Due to restrictions in how the `/tmp` directory in a `distrobox` image works, it will not play nicely with generating a local tarball for rebasing a locally built image. Going further into fixing this would required a rootful setup and I'd rather leave the `distrobox` method as an easy way to try out building a recipe for users who are not booted on a `bluebuild` image. Extra packages are installed to make the `distrobox` setup quicker and a `distrobox.ini` file is provided to easily create the container and export the CLI for use on the host machine. The `podman` binary is passed into the `distrobox` container so that all images that are built will be accessible locally and allows rootless operation without extra setup.
- Loading branch information
Showing
7 changed files
with
83 additions
and
90 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[bluebuild] | ||
image=ghcr.io/blue-build/cli:latest-distrobox | ||
exported_bins=/usr/bin/bluebuild | ||
init_hooks=ln -sf /usr/bin/distrobox-host-exec /usr/local/bin/podman | ||
pull=true | ||
replace=true | ||
start_now=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,8 +125,7 @@ init: | |
--no-git | ||
|
||
legacy-base: | ||
FROM ../+blue-build-cli-alpine --RELEASE=false | ||
RUN apk update --no-cache && apk add bash grep jq sudo coreutils | ||
FROM ../+blue-build-cli --RELEASE=false | ||
ENV BB_TEST_LOCAL_IMAGE=/etc/bluebuild/cli_test-legacy.tar.gz | ||
ENV CLICOLOR_FORCE=1 | ||
|
||
|
@@ -140,9 +139,8 @@ legacy-base: | |
DO +GEN_KEYPAIR | ||
|
||
test-base: | ||
FROM ../+blue-build-cli-alpine --RELEASE=false | ||
RUN apk update --no-cache && apk add bash grep jq sudo coreutils git && \ | ||
git config --global user.email "[email protected]" && \ | ||
FROM ../+blue-build-cli --RELEASE=false | ||
RUN git config --global user.email "[email protected]" && \ | ||
git config --global user.name "Your Name" | ||
|
||
ENV BB_TEST_LOCAL_IMAGE=/etc/bluebuild/cli_test.tar.gz | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
print_version_json() { | ||
local version="24.0.0" | ||
printf '{"Client":{"Version": "%s"}}\n' "$version" | ||
} | ||
|
||
main() { | ||
if [[ "$1" == "version" && "$2" == "-f" && "$3" == "json" ]]; then | ||
print_version_json | ||
elif [[ "$1" == "build" && "$7" == *"cli_test.tar.gz" ]]; then | ||
tarpath=$(echo "$7" | awk -F ':' '{print $2}') | ||
echo "Exporting image to a tarball (JK JUST A MOCK!)" | ||
echo "${tarpath}" | ||
touch $tarpath | ||
else | ||
echo 'Running docker' | ||
fi | ||
} | ||
|
||
main "$@" |