Skip to content

Commit 4c0ec12

Browse files
authored
feat: install bika(docker) online
一键在线安装bika 私有化版本
1 parent 0bb6cd7 commit 4c0ec12

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

install-bika.sh

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/usr/bin/env bash
2+
3+
##
4+
# install bika selfhost(docker) online
5+
##
6+
set -e
7+
8+
notes () {
9+
cat << EOF
10+
======== WARM TIPS ========
11+
Before you submit any github issue, please do the following check:
12+
* make sure the docker daemon is running
13+
* make sure you use docker compose v2: recommend 2.x.x, got $(docker compose version --short 2>/dev/null || echo not install)
14+
* check your internet connection if timeout happens
15+
* check for potential port conflicts if you have local services listening on all interfaces (e.g. another redis container listening on *:6379)
16+
===========================
17+
EOF
18+
}
19+
20+
trap notes ERR
21+
22+
if ! docker info >/dev/null 2>&1; then
23+
os=$(uname -s)
24+
arch=$(uname -m)
25+
if [ "$os" == "Linux" ]; then
26+
wget -C https://download-selfhosted.bika.ai/docker-compose/${arch}/docker-28.0.1.tgz
27+
tar -zxvf docker.tgz -C /tmp
28+
mkdir -p /etc/docker
29+
mkdir -p /usr/local/lib/docker/cli-plugins
30+
31+
mv /tmp/docker/bin/* /usr/local/bin/
32+
cp -rf /tmp/docker/docker.service /usr/lib/systemd/system/
33+
if [ ! -e "/usr/bin/docker" ];then
34+
ln -s /usr/local/bin/docker /usr/bin/
35+
fi
36+
if [ ! -e "/usr/local/lib/docker/cli-plugins/docker-compose" ]; then
37+
ln -s /usr/local/bin/docker-compose /usr/local/lib/docker/cli-plugins/
38+
fi
39+
systemctl daemon-reload
40+
systemctl enable docker
41+
systemctl start docker
42+
else
43+
echo "Docker daemon or Docker Desktop is not running... please check" 2>&1
44+
false
45+
exit 1
46+
fi
47+
fi
48+
49+
DOWNLOAD_URL='https://download-selfhosted.bika.ai/latest/bika-docker-amd64.tar.gz'
50+
51+
: "${DOWNLOAD_URL?✗ missing env}"
52+
53+
curl -fLo bika-docker-amd64.tar.gz "${DOWNLOAD_URL}"
54+
tar -zxvf bika-docker-amd64.tar.gz && cd bika
55+
[ ! -f .env ] && cat .env.template > .env
56+
57+
docker compose --profile all down -v --remove-orphans
58+
for i in {1..50}; do
59+
if docker compose --profile all pull; then
60+
if docker compose --profile all up -d; then
61+
break
62+
fi
63+
fi
64+
sleep 6
65+
done

0 commit comments

Comments
 (0)