Commit db17d37 1 parent 07e122f commit db17d37 Copy full SHA for db17d37
File tree 2 files changed +60
-0
lines changed
2 files changed +60
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,14 @@ chmod +x install.sh
18
18
source /etc/profile
19
19
```
20
20
21
+ ` azk8spull ` function can not work with zsh. So, ` bin/azk8spull ` is provided for zsh. Install it as follow if using zsh.
22
+
23
+ ```
24
+ cp bin/azk8spull /usr/bin
25
+ chmod +x /usr/bin/azk8spull
26
+ sed -i '/source \/etc\/littletools\/azk8spull.sh/d' /etc/littletools/littletools.sh
27
+ ```
28
+
21
29
## docker tools(docker-tools)
22
30
23
31
| command | params | description |
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ image=$1
3
+ if [ -z $image ]; then
4
+ echo " ## azk8spull image name cannot be null."
5
+ else
6
+ array=(` echo $image | tr ' /' ' ' ` )
7
+
8
+ domainName=" "
9
+ repoName=" "
10
+ imageName=" "
11
+
12
+ if [ ${# array[*]} -eq 3 ]; then
13
+ repoName=${array[1]}
14
+ imageName=${array[2]}
15
+ if [ " ${array[0]} " x = " docker.io" x ]; then
16
+ domainName=" dockerhub.azk8s.cn"
17
+ elif [ " ${array[0]} " x = " gcr.io" x ]; then
18
+ domainName=" gcr.azk8s.cn"
19
+ elif [ " ${array[0]} " x = " quay.io" x ]; then
20
+ domainName=" quay.azk8s.cn"
21
+ else
22
+ echo ' ## azk8spull can not support pulling $image right now.'
23
+ fi
24
+ elif [ ${# array[*]} -eq 2 ]; then
25
+ if [ " ${array[0]} " x = " k8s.gcr.io" x ]; then
26
+ domainName=" gcr.azk8s.cn"
27
+ repoName=" google_containers"
28
+ imageName=${array[1]}
29
+ else
30
+ domainName=" dockerhub.azk8s.cn"
31
+ repoName=${array[0]}
32
+ imageName=${array[1]}
33
+ fi
34
+ elif [ ${# array[*]} -eq 1 ]; then
35
+ domainName=" dockerhub.azk8s.cn"
36
+ repoName=" library"
37
+ imageName=${array[0]}
38
+ else
39
+ echo ' ## azk8spull can not support pulling $image right now.'
40
+ fi
41
+ if [ $domainName != " " ]; then
42
+ echo " ## azk8spull try to pull image from mirror $domainName /$repoName /$imageName ."
43
+ docker pull $domainName /$repoName /$imageName
44
+ if [ $? -eq 0 ]; then
45
+ echo " ## azk8spull try to tag $domainName /$repoName /$imageName to $image ."
46
+ docker tag $domainName /$repoName /$imageName $image
47
+ if [ $? -eq 0 ]; then
48
+ echo ' ## azk8spull finish pulling. '
49
+ fi
50
+ fi
51
+ fi
52
+ fi
You can’t perform that action at this time.
0 commit comments