Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add documentation: Ubuntu installation #12002

Closed
d3netxer opened this issue Apr 1, 2015 · 41 comments
Closed

add documentation: Ubuntu installation #12002

d3netxer opened this issue Apr 1, 2015 · 41 comments

Comments

@d3netxer
Copy link

d3netxer commented Apr 1, 2015

I was following this page: https://docs.docker.com/installation/ubuntulinux/

After I installed docker but and ran the command: $ sudo docker run hello-world

It returned:

FATA[0000] Get http:///var/run/docker.sock/v1.17/version: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?

can you please add a step in the instructions to run: service docker restart

This fixed the issue for me.

@ankushagarwal
Copy link
Contributor

Which ubuntu version are you using?
After I ran the instructions on ubuntu-14.04, docker daemon was automatically started after Step 3 : $ wget -qO- https://get.docker.com/ | sh and sudo docker run hello-world ran normally for me.

@ankushagarwal
Copy link
Contributor

Towards the end of the output of wget -qO- https://get.docker.com/ | sh do you see something like

Client version: 1.5.0
Client API version: 1.17
Go version (client): go1.4.1
Git commit (client): a8a31ef
OS/Arch (client): linux/amd64
Server version: 1.5.0
Server API version: 1.17
Go version (server): go1.4.1
Git commit (server): a8a31ef

?

@Pensu
Copy link
Contributor

Pensu commented Apr 2, 2015

I am also having the same issues with vivid (ubuntu-15.04) builds. docker service/daemon doesn't start automatically. You have to start it manually to get it working.

@ankushagarwal
Copy link
Contributor

I installed docker on a clean version ubuntu 15.04 using wget -qO- https://get.docker.com/ | sh and the docker daemon started automatically after the install. @Pensu : Can you reliably reproduce this issue?

@ghost
Copy link

ghost commented Apr 23, 2015

Same here for me. Docker service/daemon doesn't start automatically. I have to start it manually to get it working. I'm also on a clean Ubuntu 15.04 (not using the beta version)

docker --version displays only Docker version 1.6.0, build 4749651. On Ubuntu 14.04.2 LTS there were a lot more information. :)

@thaJeztah
Copy link
Member

docker --version displays only Docker version 1.6.0, build 4749651. On Ubuntu 14.04.2 LTS there were a lot more information. :)

Probably need to try docker version (not --version), which gives more output

@ghost
Copy link

ghost commented Apr 23, 2015

Oh gosh my fault! you're right @thaJeztah :)

@thaJeztah
Copy link
Member

You're welcome! It is confusing, so nothing to be ashamed about :)

@asmaps
Copy link

asmaps commented Apr 27, 2015

I seem to have the same problem with Ubuntu 15.04 (fresh installation). Probably it has something to do with the change from upstart to systemd as init system. I assume some startup scripts have to get adjusted to fix it.

Some info about my system:

asmaps@asmaps-x240 ~ % cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=15.04
DISTRIB_CODENAME=vivid
DISTRIB_DESCRIPTION="Ubuntu 15.04"

asmaps@asmaps-x240 ~ % docker ps
FATA[0000] Get http:///var/run/docker.sock/v1.18/containers/json: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?

asmaps@asmaps-x240 ~ % sudo service docker status
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: http://docs.docker.com

After sudo service docker start:

% sudo service docker start
asmaps@asmaps-x240 ~ % sudo service docker status
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; disabled; vendor preset: enabled)
   Active: active (running) since Mo 2015-04-27 17:25:44 CEST; 2s ago
     Docs: http://docs.docker.com
 Main PID: 7788 (docker)
   Memory: 324.0K
   CGroup: /system.slice/docker.service
           ├─7788 /usr/bin/docker -d -H fd://
           └─7867 docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 3141 -container-ip 172.17.0.1 -container-port 3141

Apr 27 17:25:45 asmaps-x240 docker[7788]: time="2015-04-27T17:25:45+02:00" level=info msg="-job allocate_interface(dbc101d4ec384ff26cd597ba34350adad8e842ae3697a3fbccd6c9bfb394947a) = OK (0)"
Apr 27 17:25:45 asmaps-x240 docker[7788]: time="2015-04-27T17:25:45+02:00" level=info msg="+job allocate_port(dbc101d4ec384ff26cd597ba34350adad8e842ae3697a3fbccd6c9bfb394947a)"
Apr 27 17:25:45 asmaps-x240 docker[7788]: time="2015-04-27T17:25:45+02:00" level=info msg="-job allocate_port(dbc101d4ec384ff26cd597ba34350adad8e842ae3697a3fbccd6c9bfb394947a) = OK (0)"
Apr 27 17:25:45 asmaps-x240 docker[7788]: time="2015-04-27T17:25:45+02:00" level=info msg="+job log(start, dbc101d4ec384ff26cd597ba34350adad8e842ae3697a3fbccd6c9bfb394947a, scrapinghub/devpi:latest)"
Apr 27 17:25:45 asmaps-x240 docker[7788]: time="2015-04-27T17:25:45+02:00" level=info msg="-job log(start, dbc101d4ec384ff26cd597ba34350adad8e842ae3697a3fbccd6c9bfb394947a, scrapinghub/devpi:latest) = OK (0)"
Apr 27 17:25:45 asmaps-x240 docker[7788]: time="2015-04-27T17:25:45+02:00" level=info msg="Loading containers: done."
Apr 27 17:25:45 asmaps-x240 docker[7788]: time="2015-04-27T17:25:45+02:00" level=info msg="docker daemon: 1.6.0 4749651; execdriver: native-0.2; graphdriver: aufs"
Apr 27 17:25:45 asmaps-x240 docker[7788]: time="2015-04-27T17:25:45+02:00" level=info msg="+job acceptconnections()"
Apr 27 17:25:45 asmaps-x240 docker[7788]: time="2015-04-27T17:25:45+02:00" level=info msg="-job acceptconnections() = OK (0)"
Apr 27 17:25:45 asmaps-x240 docker[7788]: time="2015-04-27T17:25:45+02:00" level=info msg="Daemon has completed initialization"

asmaps@asmaps-x240 ~ % docker version
Client version: 1.6.0
Client API version: 1.18
Go version (client): go1.4.2
Git commit (client): 4749651
OS/Arch (client): linux/amd64
Server version: 1.6.0
Server API version: 1.18
Go version (server): go1.4.2
Git commit (server): 4749651
OS/Arch (server): linux/amd64

asmaps@asmaps-x240 ~ % docker ps
CONTAINER ID        IMAGE                      COMMAND             CREATED             STATUS              PORTS                    NAMES
dbc101d4ec38        scrapinghub/devpi:latest   "/run.sh"           55 minutes ago      Up About a minute   0.0.0.0:3141->3141/tcp   devpi

Note:
I installed docker with wget -qO- https://get.docker.com/ | sh

@jjcomer
Copy link

jjcomer commented Apr 28, 2015

👍 I'm seeing the same results as @asmaps on my fresh 15.04 install (also installed docker with the script)

@triptec
Copy link

triptec commented May 4, 2015

+1. I need to sudo service docker restart after every reboot

@vkorenev
Copy link

vkorenev commented May 4, 2015

I'm having the same issue on Ubuntu 15.04. After "sudo service docker restart" it starts working.

@echernyavskiy
Copy link

Docker service won't start automatically for me as well:

> cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.2 LTS"


> docker version
Client version: 1.6.0
Client API version: 1.18
Go version (client): go1.4.2
Git commit (client): 4749651
OS/Arch (client): linux/amd64
FATA[0000] Get http:///var/run/docker.sock/v1.18/version: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?

@thaJeztah
Copy link
Member

@tianon @jfrazelle are there still known issues with the install script? Given it's a mish-mash of versions reported above, I'm not sure all reporters are having the same issue. Anything you think could be worthy to check in order to debug?

1 similar comment
@thaJeztah
Copy link
Member

@tianon @jfrazelle are there still known issues with the install script? Given it's a mish-mash of versions reported above, I'm not sure all reporters are having the same issue. Anything you think could be worthy to check in order to debug?

@jessfraz
Copy link
Contributor

Seems to me it is the same problem. People need to run systemctl enable
docker for it to restart on 15.04 because it is systemd
This will be fixed in our new install script which uses the new rpms and
debs we have been working on.

On Saturday, May 9, 2015, Sebastiaan van Stijn notifications@github.com
wrote:

@tianon https://github.com/tianon @jfrazelle
https://github.com/jfrazelle are there still known issues with the
install script? Given it's a mish-mash of versions reported above, I'm not
sure all reporters are having the same issue. Anything you think could be
worthy to check in order to debug?


Reply to this email directly or view it on GitHub
#12002 (comment).

@innovia
Copy link

innovia commented May 14, 2015

for me (on Ubuntu 14.04) looking into /var/log/upstart/docker.io.log hint me in the direction apparmor was missing

so i did apt-get install apparmor followed by

sudo service docker restart

and it worked

@vkorenev
Copy link

@innovia the issue with Ubuntu 15.04 is another one. Apparmor is installed. Systemd is used instead of Upstart.

@attilagyorffy
Copy link

I am not familiar with the docker internals but it is clear to me that either docker itself sort one of its dependencies has a dependency on apparmor itself. Now, obviously having to manually install a package is non-ideal. If I could, I'd open a pull request and patch the debian/ubuntu package dependencies but I'm afraid I am not so great (at least not yet).

What I'm trying to say is, maybe instead of updating the documentation, the dependency tree should be fixed somehow.

@michielbdejong
Copy link
Contributor

Talking only about 15.04, the Ubuntu install instructions do not describe how to install on 15.04 yet, and just doing wget -qO- https://get.docker.com/ | sh will work only until you reboot. So that's a problem, and here is a workaround:

  • Ubuntu 15.04 uses systemd, and the get.docker.com install script does not seem to support this yet.
  • After running wget -qO- https://get.docker.com/ | sh, run docker version to check that it's running. This should be the case.
  • Now, also check if it is configured to run at startup, with systemctl is-enabled docker. If this shows 'disabled', then you need have a problem, and need to run systemctl enable docker.*)
  • Reboot the server and run docker version again, to check that the systemctl enable docker command fixed the problem.

*) There may be a better way to do this, I'm new at systemd, but this is what worked for me.

@CristianCantoro
Copy link

There is a fix for this problem for Ubuntu 15.04:
sudo systemctl enable docker
(source)

@maheshsundaram
Copy link

Wow, glad to have found this issue, but sudo systemctl enable docker doesn't work for me, as it shows:

Synchronizing state for docker.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d docker defaults
Executing /usr/sbin/update-rc.d docker enable
Failed to execute operation: Operation not supported

and sudo systemctl is-enabled docker shows masked.

@maheshsundaram
Copy link

Doh, so I unmasked both docker.service and docker.socket, but still trouble:

chronos@peppy:~$ docker version
Client version: 1.6.2
Client API version: 1.18
Go version (client): go1.4.2
Git commit (client): 7c8fca2
OS/Arch (client): linux/amd64
FATA[0000] Get http:///var/run/docker.sock/v1.18/version: dial unix /var/run/docker.sock: permission denied. Are you trying to connect to a TLS-enabled daemon without TLS? 

@jamespercy
Copy link

sudo apt-get install apparmor and restarting the docker service worked for me

@thaJeztah
Copy link
Member

sudo apt-get install apparmor and restarting the docker service worked for me

@jfrazelle ^^ I think you were working on that part as well (apparmor)?

@amarcionek
Copy link

Ubuntu 15.04 comes with Docker 1.5 and worked out of the box. But after wget -qO- https://get.docker.com/ | sh it not longer did. But sudo systemctl enable docker worked for me.

@vadviktor
Copy link

I had this very issue -though remembered to solve it this way back from a while ago- I'd too recommend someone expert on Ubuntu and debian installs to fix up (at least warning users) to install Apparmor as a dependency, please. I am not keen on understanding high level bash scripts that's why I cannot create a PR myself, sorry.

@Jean85
Copy link

Jean85 commented Jun 25, 2015

sudo systemctl enable docker fixed it for me too.
I was on a clean 15.04 installation, I installed docker 1.7.0 from get.docker.com
Thanks @michielbdejong

@greg0ire
Copy link

Personally, I had to manually edit the /lib/systemd/system/docker.service and get rid -H fd:// option. I have no idea what I am doing though.

@Jean85
Copy link

Jean85 commented Jun 26, 2015

I also had to edit /lib/systemd/system/docker.service, but just to edit the options.
That's because upstart implementations uses /etc/default/docker.conf to inject options as DOCKER_OPTS. Systemd implementations instead lacks something alike, but I think it merits an other issue about it.

@ankushagarwal
Copy link
Contributor

This is not a docs/only issue. This is an issue with the docker-lxc package for 15.04. The package install should take care of enabling docker daemon in systemd

@montanaflynn
Copy link

I also ran into this issue on Ubuntu mate based on 15.04 although I actually prefer to not have docker run on startup so I just turn it on and off with sudo service docker start and sudo service docker stop as needed.

@JustKain
Copy link

all so simple, first of all try to write ¨sudo docker run hello-world¨, daemon answer only to root user >< i spend so many time read about this problem, try so many different methods to fix this, and after all I enter into var/run/docker/docker.socket and see ther daemon user is root, that´s why I try to write sudo before docker word and it´s work >< 14.04 Ubuntu

@michielbdejong
Copy link
Contributor

Just confirmed that systemctl enable docker is still missing from the https://get.docker.com/ script when run on Ubuntu 15.04. Is someone working on this?

@ankushagarwal
Copy link
Contributor

@michielbdejong : Related discussion here : #14217

@thaJeztah
Copy link
Member

Also, changes are coming to the installation process; #13680

@ankushagarwal
Copy link
Contributor

@thaJeztah : I did not follow that PR, but does it address the issue of docker not starting automatically on Ubuntu 15.04 and above?

@thaJeztah
Copy link
Member

@ankushagarwal not fully sure; iiuc, updating the install scripts is part of that plan, and it's possible that automatic starting is part of that rewrite. However, I think I also read that making Docker start automatically on boot was intended to be a change/decision made by the user.

Erm, so in short: I don't know (yet) 😊

@srcspider
Copy link

Running 15.04, the sudo systemctl enable docker solution worked fine for me. No errors.

Restarted to make sure it worked and there's no problems.

@thaJeztah the docs should be updated to reflect the choice, if it's intended as a choice. It would also probably help to add to the docs the official instructions for making the docker command run with out sudo

@thaJeztah
Copy link
Member

@srcspider agreed!

ewindisch pushed a commit to ewindisch/docker that referenced this issue Jul 22, 2015
Fixes moby#12002

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
gabrielgrant added a commit to gabrielgrant/docker that referenced this issue Jul 23, 2015
The service isn't started by default on a clean Ubuntu 14.04 install

Fixes moby#12002
calavera pushed a commit to calavera/docker that referenced this issue Jul 25, 2015
Fixes moby#12002

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
tiborvass pushed a commit to tiborvass/docker that referenced this issue Jul 27, 2015
Fixes moby#12002

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
@ailjushkin
Copy link

on redhat

chkconfig docker on
service docker restart

Stopping docker: [FAILED]
Starting cgconfig service: [ OK ]
Starting docker: [ OK ]

[root@tmp]# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from hello-world

535020c3e8ad: Pull complete
af340544ed62: Pull complete
hello-world:latest: The image you are pulling has been verified. Important: image verification is a >tech preview feature and should not be relied on to provide security.
Digest: sha256:02fee8c3220ba806531f606525eceb83f4feb654f62b207191b1c9209188dedd
Status: Downloaded newer image for hello-world:latest

Hello from Docker.
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:

  1. The Docker client contacted the Docker daemon.
  2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
  3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
  4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker Hub account:
https://hub.docker.com

For more examples and ideas, visit:
https://docs.docker.com/userguide/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.