-
Notifications
You must be signed in to change notification settings - Fork 157
/
docker.sh
executable file
·114 lines (85 loc) · 3.5 KB
/
docker.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/bin/sh
if [[ $(uname -m) == 'arm64' ]]; then
rm -f ./package.json.original
cp ./package.json ./package.json.original
sed 's/x64/arm64/g' ./package.json > ./package.json.new && mv ./package.json.new ./package.json
sed 's/linux-unpacked/linux-arm64-unpacked/g' ./package.json > ./package.json.new && mv ./package.json.new ./package.json
fi
docker version
docker info
# --no-cache
#--build-arg BUST_CACHE=$(date +%Y%m%d-%H%M%S)
#--build-arg BUST_CACHE=$(date +%s)
#--build-arg BUST_CACHE=`date +%s`
#--build-arg BUST_CACHE=1
docker build --progress=plain --build-arg BUST_CACHE=$(date +%Y%m%d-%H%M%S) -f ./Dockerfile -t thorium-docker-image .
# --platform linux/x86_64
# --platform=linux/amd64
#docker image ls
#docker ps -a
(docker stop thorium-docker-container || echo ok_stop) && echo _ok_stop
#(docker kill thorium-docker-container || echo ok_kill) && echo _ok_kill
(docker rm --force thorium-docker-container || echo ok_rm) && echo _ok_rm
npm run clean
# -d
# --log-driver=none -a stdin
# --log-driver=none -a stdout -a stderr
# | xargs echo DOCKER_OUT:
# --interactive -i
# --tty -t
# -it
# --platform linux/arm64
# --publish 8888:8888
# -p 127.0.0.1:9999:9999
# --volume list
# --detach
# --rm
docker run --name thorium-docker-container thorium-docker-image
# read -p "WAIT FOR DONE_PRESS_ENTER_KEY_NOW ..."
#docker logs -f thorium-docker-container
# docker exec -it thorium-docker-container /bin/sh
#(docker stop thorium-docker-container || echo ok_stop2) && echo _ok_stop2
#(docker kill thorium-docker-container || echo ok_kill2) && echo _ok_kill2
#(docker rm --force thorium-docker-container || echo ok_rm2) && echo _ok_rm2
# if [[ $(uname -m) == 'arm64' ]]; then
# sed 's/x64/arm64/g' ./package.json > ./package.json.new && mv ./package.json.new ./package.json
# sed 's/linux-unpacked/linux-arm64-unpacked/g' ./package.json > ./package.json.new && mv ./package.json.new ./package.json
# fi
# ??
# Thorium-2.4.0-alpha.1-arm64.AppImage
# EDRLab.ThoriumReader_2.4.0-alpha.1_arm64.deb
# Thorium-2.3.0.AppImage
# EDRLab.ThoriumReader_2.3.0_amd64.deb
# WILDCARDS GLOBS NOT SUPPORTED!
# docker cp thorium-docker-container:/THORIUM/release/*.AppImage .
# docker cp thorium-docker-container:/THORIUM/release/*.deb .
## EXEC requires a running container, whereas CP does not
# mkdir -p release || echo ok
# docker exec thorium-docker-container sh -c "tar -cf - /THORIUM/release/*.AppImage /THORIUM/release/*.deb" | tar --strip-components=2 -xf - -C release
FILENAME1=
FILENAME2=
VERSION=`cat package.json | grep 'version": ' | sed 's/ "version": "//' | sed 's/",//'`
if [[ $(uname -m) == 'arm64' ]]; then
FILENAME1="Thorium-"$VERSION"-arm64.AppImage"
FILENAME2="EDRLab.ThoriumReader_"$VERSION"_arm64.deb"
else
FILENAME1="Thorium-"$VERSION".AppImage"
FILENAME2="EDRLab.ThoriumReader_"$VERSION"_amd64.deb"
fi
echo $FILENAME1
echo $FILENAME2
mkdir -p release || echo ok
docker cp thorium-docker-container:/THORIUM/release/$FILENAME1 release
docker cp thorium-docker-container:/THORIUM/release/$FILENAME2 release
(docker stop thorium-docker-container || echo ok_stop) && echo _ok_stop
docker logs -f thorium-docker-container
docker logs thorium-docker-container
# docker exec -it thorium-docker-container /bin/sh
#(docker stop thorium-docker-container || echo ok_stop2) && echo _ok_stop2
#(docker kill thorium-docker-container || echo ok_kill2) && echo _ok_kill2
#(docker rm --force thorium-docker-container || echo ok_rm2) && echo _ok_rm2
if [[ $(uname -m) == 'arm64' ]]; then
rm -f ./package.json
mv ./package.json.original ./package.json
fi
git status