-
Notifications
You must be signed in to change notification settings - Fork 22
/
docker-run.sh
executable file
·37 lines (35 loc) · 1.46 KB
/
docker-run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
# OpenBmclAPI (Golang Edition)
# Copyright (C) 2024 Kevin Z <[email protected]>
# All rights reserved
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
docker pull craftmine/go-openbmclapi:latest || {
echo "[ERROR] Failed to pull docker image 'craftmine/go-openbmclapi:latest'"
if ! docker images craftmine/go-openbmclapi | grep latest; then
echo "Cannot find docker image 'craftmine/go-openbmclapi:latest'"
exit 1
fi
}
docker run -d --name my-go-openbmclapi \
-e CLUSTER_ID=${CLUSTER_ID} \
-e CLUSTER_SECRET=${CLUSTER_SECRET} \
-e CLUSTER_PUBLIC_PORT=${CLUSTER_PUBLIC_PORT} \
-e CLUSTER_IP=${CLUSTER_IP} \
-v "${PWD}/cache":/opt/openbmclapi/cache \
-v "${PWD}/data":/opt/openbmclapi/data \
-v "${PWD}/logs":/opt/openbmclapi/logs \
-v "${PWD}/config.yaml":/opt/openbmclapi/config.yaml \
-p ${CLUSTER_PORT}:4000 \
craftmine/go-openbmclapi:latest