This repository was archived by the owner on Dec 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbuild-images.sh
More file actions
executable file
·61 lines (49 loc) · 1.36 KB
/
build-images.sh
File metadata and controls
executable file
·61 lines (49 loc) · 1.36 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env bash
set -eo pipefail
NC='\033[0m'
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
while [ $# -gt 0 ]; do
if [[ $1 == *"--"* ]]; then
param="${1/--/}"
declare ${param}="true"
fi
shift
done
if ! [ -x "$(command -v git)" ]; then
echo -e "${RED}Error: git is not installed.${NC}" >&2
echo -e "Aborting.${NC}" >&2
exit 1
fi
if [ ! -z ${nopurge} ]; then
echo -e "${YELLOW}Purging intermediate build products is disabled.${NC}"
fi
if [ ! -z ${nopull} ]; then
echo -e "${YELLOW}Latest upstream image will not be force-pulled.${NC}"
fi
if [ ! -z ${nogpubuild} ]; then
echo -e "${YELLOW}Image build for the gpuminer is disabled.${NC}"
fi
echo -e "${GREEN}Refreshing this Git repository...${NC}"
git pull
echo
if [ -z ${nogpubuild} ]; then
echo -e "${GREEN}Rebuilding GPU miner sources... (this might take some time)${NC}"
docker build --build-arg CACHEBUST=$(date +%s) -t local/gpuminer -f Dockerfile.gpuminer .
echo
fi
if [ -z ${nopurge} ]; then
echo -e "${GREEN}Removing intermediate build products...${NC}"
docker image prune -f
docker rmi nvidia/cuda:11.0-devel-ubuntu18.04
echo
fi
if [ -z ${nopull} ]; then
echo -e "${GREEN}Pulling latest upstream image...${NC}"
docker pull blockcollider/bcnode:latest
echo
fi
echo -e "${GREEN}Showing all locally available Docker images:${NC}"
docker images
echo -e "${GREEN}Done.${NC}"