-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
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,11 @@ | ||
FROM scratch | ||
COPY tars tars | ||
COPY etc etc | ||
COPY scripts scripts | ||
COPY manifests manifests | ||
COPY registry registry | ||
|
||
ENV cloudDomain=${cloudDomain:-"127.0.0.1.nip.io"} | ||
ENV cloudPort="" | ||
|
||
CMD ["bash scripts/init.sh"] |
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,51 @@ | ||
#!/bin/bash | ||
readonly ARCH=${1:-amd64} | ||
set -e | ||
|
||
mkdir -p tars | ||
|
||
RetryPullImageInterval=3 | ||
RetryPullFileInterval=3 | ||
RetrySleepSeconds=3 | ||
|
||
retryPullFile() { | ||
local file=$1 | ||
local retry=0 | ||
local retryMax=3 | ||
set +e | ||
while [ $retry -lt $RetryPullFileInterval ]; do | ||
curl $file --create-dirs -o ./etc/minio-binaries/mc >/dev/null && break | ||
retry=$(($retry + 1)) | ||
echo "retry pull file $file, retry times: $retry" | ||
sleep $RetrySleepSeconds | ||
done | ||
set -e | ||
if [ $retry -eq $retryMax ]; then | ||
echo "pull file $file failed" | ||
exit 1 | ||
fi | ||
} | ||
|
||
retryPullImage() { | ||
local image=$1 | ||
local retry=0 | ||
local retryMax=3 | ||
set +e | ||
while [ $retry -lt $RetryPullImageInterval ]; do | ||
sealos pull --policy=always --platform=linux/"${ARCH}" $image >/dev/null && break | ||
retry=$(($retry + 1)) | ||
echo "retry pull image $image, retry times: $retry" | ||
sleep $RetrySleepSeconds | ||
done | ||
set -e | ||
if [ $retry -eq $retryMax ]; then | ||
echo "pull image $image failed" | ||
exit 1 | ||
fi | ||
} | ||
|
||
retryPullImage ghcr.io/labring/sealos-cloud-devbox-controller:latest | ||
retryPullImage ghcr.io/labring/sealos-cloud-devbox-frontend:latest | ||
|
||
sealos save -o tars/devbox-controller.tar ghcr.io/labring/sealos-cloud-devbox-controller:latest | ||
sealos save -o tars/devbox-frontend.tar ghcr.io/labring/sealos-cloud-devbox-frontend:latest |
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,3 @@ | ||
#!/bin/bash | ||
|
||
set -e |
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