commonsearch / cosr-front

Frontend of Common Search. Go server for fetching and rendering results + HTML5 UI to browse them.
https://uidemo.commonsearch.org
Apache License 2.0
60 stars 13 forks source link

Update installation instructions for first-time users of Docker #27

Closed mewmew closed 7 years ago

mewmew commented 8 years ago

When following the step-by-step installation instructions, the make docker_pull step fails, since the Docker daemon has not yet been started.

To make it easier for first-time users of Docker to jump straight in, add an additional step prior to the make docker_pull step, which describes how to start the Docker daemon.

The error reported if the Docker is not yet started is as follows.

u@x1 ~/g/s/g/c/cosr-front> make docker_pull
docker pull commonsearch/local-front
Using default tag: latest
Warning: failed to get default registry endpoint from daemon (Cannot connect to the Docker daemon. Is the docker daemon running on this host?). Using system default: https://index.docker.io/v1/
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
Makefile:133: recipe for target 'docker_pull' failed
make: *** [docker_pull] Error 1
chaconnewu commented 8 years ago

Adding the following two steps before make docker_pull might solve the issue: boot2docker up and eval "$(boot2docker shellinit)

mewmew commented 8 years ago

I don't have boot2docker on my system (using Arch Linux). However, starting the Docker daemon (i.e. sudo systemctl start docker) was enough to resolve this issue.

The only other issue is that since the Makefiles invoke docker directly without using sudo, the user would have to be added to the docker group (which may not be desirable in all cases, see the Docker daemon attack surface article).

A potential solution to this issue is to create an alias for docker as described in this article.

alias docker="sudo /usr/bin/docker"
mewmew commented 8 years ago

Note that the installation instructions for Arch Linux solved all of these issues except the one regarding the docker group.

I'd suggest adding a note regarding docker security to the installation instructions, and perhaps suggest that adding an alias for docker as described above is one possible solution.

mewmew commented 8 years ago

From https://github.com/commonsearch/cosr-front/pull/28#issuecomment-196429886

This pull request was sent out prematurely. It turns out that aliases are ignored by make, or rather only used by interactive terminal environments. In either case, the described solution does not fix the initial problem.

mewmew commented 8 years ago

If anyone has an alternative solution to mitigate the security implications of adding your user to the docker group, please let us know.

The suggested docker alias (see pull request #27) turned out not to work in combination with make.

mewmew commented 7 years ago

Close the issue for now as it has remained inactive for more than 6 months.

Anyone with further insight into the current status of this issue, may re-open it or add comments of the current progress.