Skip to content

Commit

Permalink
fix docker param
Browse files Browse the repository at this point in the history
  • Loading branch information
cuisongliu committed Sep 4, 2019
1 parent d95590a commit 4869aef
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
15 changes: 6 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ install container from url:
location file:
```shell script
container-install install \
--docker T \
--d \
--host 172.16.213.131 \
--host 172.16.213.132 \
--user root \
Expand All @@ -21,7 +21,7 @@ install container from url:
remote url:
```shell script
container-install install \
--docker T \
--d \
--host 172.16.213.131 \
--host 172.16.213.132 \
--user root \
Expand All @@ -37,7 +37,6 @@ install container from url:
location file:
```shell script
container-install install \
--docker F \
--host 172.16.213.131 \
--host 172.16.213.132 \
--user root \
Expand All @@ -50,7 +49,6 @@ install container from url:
remote url:
```shell script
container-install install \
--docker F \
--host 172.16.213.131 \
--host 172.16.213.132 \
--user root \
Expand All @@ -65,7 +63,7 @@ install container from url:
uninstall container:
```shell script
container-install uninstall \
--docker T \
--d \
--host 172.16.213.131 \
--host 172.16.213.132 \
--user root \
Expand All @@ -77,7 +75,6 @@ uninstall container:
uninstall container:
```shell script
container-install uninstall \
--docker F \
--host 172.16.213.131 \
--host 172.16.213.132 \
--user root \
Expand All @@ -93,14 +90,14 @@ use --pk=/root/.ssh/id_rsa is private key login
### Print Download Url
print download url for docker:
```shell script
container-install print --docker T
container-install print --d
```

the docker Newest version is v19.03.0.
ex:

```shell script
cuisongliu@cuisongliu-PC:~$ container-install print --docker T
cuisongliu@cuisongliu-PC:~$ container-install print --d
https://download.docker.com/linux/static/stable/x86_64/docker-17.03.0-ce.tgz
https://download.docker.com/linux/static/stable/x86_64/docker-17.03.1-ce.tgz
https://download.docker.com/linux/static/stable/x86_64/docker-17.03.2-ce.tgz
Expand Down Expand Up @@ -132,7 +129,7 @@ https://download.docker.com/linux/static/stable/x86_64/docker-19.03.0.tgz
the containerd Newest version is v1.2.7
ex:
```shell script
cuisongliu@cuisongliu-PC:~$ container-install print --docker F
cuisongliu@cuisongliu-PC:~$ container-install print
https://github.com/containerd/containerd/releases/download/v1.1.0/containerd-1.1.0.linux-amd64.tar.gz
https://github.com/containerd/containerd/releases/download/v1.1.1/containerd-1.1.1.linux-amd64.tar.gz
https://github.com/containerd/containerd/releases/download/v1.1.2/containerd-1.1.2.linux-amd64.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ func init() {
// Here you will define your flags and configuration settings.
// Cobra supports persistent flags, which, if defined here,
// will be global for your application.
rootCmd.PersistentFlags().StringVar(&install.Docker, "docker", "T", "install the container runtime is docker?if false,the runtime is containerd(T/F)")
rootCmd.PersistentFlags().BoolVarP(&install.Docker, "docker", "d", false, "install the container runtime is docker?if false,the runtime is containerd(T/F)")
}
5 changes: 2 additions & 3 deletions install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ package install

import (
"github.com/cuisongliu/container-install/install/command"
"strings"
"sync"
)

var Docker string
var Docker bool
var Hosts []string

const (
Expand Down Expand Up @@ -66,7 +65,7 @@ func (s Installer) Print() {
}

func IsDocker() bool {
return strings.ToUpper(Docker) == "T"
return Docker
}

func factory(itype int, host string) {
Expand Down

0 comments on commit 4869aef

Please sign in to comment.