Docker error while discourse installation

Can anyone please help me with this. I tried several times but keep on getting this error.
I even tried to install docker first and then followed the standard installation method then also i am not able to move ahead and get stuck here

root@subsdeal:/var/discourse# ./discourse-setup
/usr/bin/docker
Failed to find docker.io or docker on your PATH.
Enter to install Docker from https://get.docker.com/ or Ctrl+C to exit
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 15742  100 15742    0     0   101k      0 --:--:-- --:--:-- --:--:--  101k
# Executing docker install script, commit: 28bc4d09b3938ea30c69407d198ee8ece52c3e12
Warning: the "docker" command appears to already exist on this system.

If you already have Docker installed, this script can cause trouble, which is
why we're displaying this warning and provide the opportunity to cancel the
installation.

If you installed the current Docker package using this script and are using it
again to update Docker, you can safely ignore this message.

You may press Ctrl+C now to abort this script.
+ sleep 20
+ sh -c apt-get update -qq >/dev/null
+ sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null
+ sh -c curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
+ sh -c echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu focal stable" > /etc/apt/sources.list.d/docker.list
+ sh -c apt-get update -qq >/dev/null
+ sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends  docker-ce-cli docker-scan-plugin docker-ce >/dev/null
+ version_gte 20.10
+ [ -z  ]
+ return 0
+ sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq docker-ce-rootless-extras >/dev/null
+ sh -c docker version
Client: Docker Engine - Community
 Version:           20.10.8
 API version:       1.41
 Go version:        go1.16.6
 Git commit:        3967b7d
 Built:             Fri Jul 30 19:54:27 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.8
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.6
  Git commit:       75249d8
  Built:            Fri Jul 30 19:52:33 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.6
  GitCommit:        d71fcd7d8303cbf684402823e425e9dd2e99285d
 runc:
  Version:          1.0.0-rc95
  GitCommit:        b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

================================================================================

To run Docker as a non-privileged user, consider setting up the
Docker daemon in rootless mode for your user:

    dockerd-rootless-setuptool.sh install

Visit https://docs.docker.com/go/rootless/ to learn about rootless mode.


To run the Docker daemon as a fully privileged service, but granting non-root
users access, refer to https://docs.docker.com/go/daemon-access/

WARNING: Access to the remote API on a privileged Docker daemon is equivalent
         to root access on the host. Refer to the 'Docker daemon attack surface'
         documentation for details: https://docs.docker.com/go/attack-surface/

================================================================================

/usr/bin/docker
Still failed to find docker.io or docker on your PATH.
Docker install failed. Quitting.
root@subsdeal:/var/discourse#

Thanks

1 Like

What distro are you using? @uckelman sent a PR changing the docker detection logic and it was just merged today and this message comes from there, so it may be related.

1 Like

Oh, hang on. I see what’s wrong. I’ll submit a fix shortly.

2 Likes

PR: FIX: Use the return code from which correctly by uckelman · Pull Request #557 · discourse/discourse_docker · GitHub

4 Likes

Thanks for following it up @uckelman!

@UnicornX can you try:

cd /var/discourse
git pull
./discourse-setup
2 Likes

working fine now @Falco
Thanks

2 Likes

I had the same error when installing, but pressed enter anyways (on Ubuntu 22.04.1 LTS), is this why my themes and components don’t work now? (see https://meta.discourse.org/t/light-theme-broke-with-update/160596/17?u=sjefromijn