Skip to content

Commit

Permalink
hmm, wait after -v- before makes difference(!). quieter pull
Browse files Browse the repository at this point in the history
  • Loading branch information
traceypooh committed Mar 14, 2024
1 parent fc3c796 commit 8f01145
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ export FQDN=$(hostname -f)
podman -v > /dev/null || echo 'please install the podman package first'
podman -v > /dev/null || exit 1


# in background, wait for the `bootstrap.sh`, running in the first `podman run` below, to finish
(
while $(! podman secret ls |grep -q ' BOOTSTRAPPED '); do sleep 1; done
podman commit -q hind-init localhost/hind
podman secret rm BOOTSTRAPPED > /dev/null
) &
wait


(
set -x
# We need to shared these 2 directories "inside" the running `hind` container, and "outside" on
Expand All @@ -23,23 +33,14 @@ podman -v > /dev/null || exit 1
# container will effect us, the outside/VM.
VLC=$(realpath /var/lib/containers 2>/dev/null || echo /var/lib/containers)

podman pull $IMG
podman pull -q $IMG
podman run --net=host --privileged --cgroupns=host \
-v ${VLC}:/var/lib/containers \
-e FQDN -e HOST_UNAME \
--rm --name hind-init -q "$@" $IMG
)


# in background, wait for the `bootstrap.sh`, running in the first `podman run` above, to finish
(
while $(! podman secret ls |grep -q ' BOOTSTRAPPED '); do sleep 1; done
podman commit -q hind-init localhost/hind
podman secret rm BOOTSTRAPPED > /dev/null
) &
wait


if [ "$HOST_UNAME" = Darwin ]; then
ARGS='-p 6000:4646 -p 8000:80 -p 4000:443 -v /sys/fs/cgroup:/sys/fs/cgroup:rw'
else
Expand Down

0 comments on commit 8f01145

Please sign in to comment.