basefs icon indicating copy to clipboard operation
basefs copied to clipboard

[BUG] When we have docker-cli but there is no dockerd, sealer run will get a error

Open Lan-ce-lot opened this issue 2 years ago • 1 comments

What happened:

Sometime we have dockercli but there is no dockerd.

❯ ./sealer run my-kube:v1.22.15 -m 172.16.0.10 -p xx
2023-05-18 22:11:40 [INFO] [run.go:252] start to create new cluster with image: my-kube:v1.22.15

2023-05-18 22:11:43 [INFO] [installer.go:456] The cri is docker, cluster runtime type is kubernetes


+ set -e
+++ dirname /var/lib/sealer/data/my-cluster/rootfs/scripts/docker.sh
++ cd /var/lib/sealer/data/my-cluster/rootfs/scripts
++ pwd
+ scripts_path=/var/lib/sealer/data/my-cluster/rootfs/scripts
+ image_dir=/var/lib/sealer/data/my-cluster/rootfs/scripts/../images
+ DOCKER_VERSION=19.03.15
+ storage=/var/lib/docker
+ mkdir -p /var/lib/docker
+ utils_command_exists docker
+ command -v docker
+ disable_selinux
+ '[' -s /etc/selinux/config ']'
+ systemctl daemon-reload
+ systemctl restart docker.service
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xeu docker.service" for details.
Usage:
  sealer run [flags]

Examples:

run cluster by Clusterfile:
  sealer run -f Clusterfile
run cluster by CLI flags:
  sealer run docker.io/sealerio/kubernetes:v1-22-15-sealerio-2 -m 172.16.130.21 -n 172.16.130.22 -p 'Sealer123'
run app image:
  sealer run localhost/nginx:v1


Flags:
  -f, --Clusterfile string   Clusterfile path to run a Kubernetes cluster
      --apps strings         override default AppNames of sealer image
      --cmds strings         override default LaunchCmds of sealer image
  -e, --env strings          set custom environment variables
  -h, --help                 help for run
      --ignore-cache         whether ignore cache when distribute sealer image, default is false.
  -m, --masters string       set count or IPList to masters
      --mode string          load images to the specified registry in advance (default "apply")
  -n, --nodes string         set count or IPList to nodes
  -p, --passwd string        set cloud provider or baremetal server password
      --pk string            set baremetal server private key (default "/root/.ssh/id_rsa")
      --pk-passwd string     set baremetal server private key password
      --port uint16          set the sshd service port number for the server (default port: 22) (default 22)
  -u, --user string          set baremetal server username (default "root")

Global Flags:
      --color string               set the log color mode, the possible values can be [never always] (default "always")
      --config string              config file of sealer tool (default is $HOME/.sealer.json)
  -d, --debug                      turn on debug mode
      --hide-path                  hide the log path
      --hide-time                  hide the log time
      --log-to-file                write log message to disk (default true)
  -q, --quiet                      silence the usage when fail
      --remote-logger-url string   remote logger url, if not empty, will send log to this url
      --task-name string           task name which will embedded in the remote logger header, only valid when --remote-logger-url is set

2023-05-18 22:11:44 [ERROR] [root.go:75] sealer-unknown: failed to install docker: execute command(bash /var/lib/sealer/data/my-cluster/rootfs/scripts/docker.sh) on host (172.16.0.10): error(failed to execute command(export LocalRegistryDomain="sea.hub"; export LocalRegistryPort="5000"; export LocalRegistryURL="sea.hub:5000"; export RegistryDomain="sea.hub"; export RegistryPort="5000"; export RegistryURL="sea.hub:5000"; bash /var/lib/sealer/data/my-cluster/rootfs/scripts/docker.sh) on host(172.16.0.10): error(exit status 1))

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

  • sealer version (use sealer version):
  • Cloud provider or hardware configuration:
  • OS (e.g: cat /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:

Lan-ce-lot avatar May 18 '23 14:05 Lan-ce-lot

For now, we would recommend that you install the cluster image in a clean environment.

starnop avatar Jul 10 '23 09:07 starnop