Cannot connect to the Docker daemon on ubuntu 14.04 - linux

I have a VPS hosting with Ubuntu installed
Description: Ubuntu 14.04.3 LTS
Release: 14.04
Codename: trusty
Kernel version is 3.13.0-*
I tried to install docker and I went through all steps as mentioned here and everything installed and worked fine with the exception of this:
For Ubuntu Trusty, Wily, and Xenial, it’s recommended to install the
linux-image-extra kernel package. The linux-image-extra package allows
you use the aufs storage driver.
To install the linux-image-extra package for your kernel version
sudo apt-get install linux-image-extra-$(uname -r)
When I was trying to run this command I've been told that
E: Unable to locate package linux-image-extra-3.13.0-042stab113.17
E: Couldn't find any package by regex 'linux-image-extra-3.13.0-042stab113.17'
Anyway seems like docker is installed and I can start it using
service docker start
And when I run this command it says that
docker start/running, process 12235
But when I check the status it says me that
docker stop/waiting
And when I try to start hello-world container it says me that
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
Error: failed to start containers: hello-world
I've already installed docker on my OS X following all steps from official tutorial and it worked fine,
but can't figure out what's wrong with my ubuntu.
Thanks in advance!

Related

Snapcraft doesnt install snaps, gives a mount error

had it all working and the next day it randomly gave this error to me. I dont know what I did.
also i had a error on the ubuntu screen itself when executed this command “unable to mount volume an operation is already pending” something like that. cant get to re create this
$ snap install ubuntu-frame
error: cannot perform the following tasks:
Run hook prepare-plug-graphics-core20 of snap "ubuntu-frame" (run hook "prepare-plug-graphics-core20": cannot perform operation: mount --bind /snap/core20/current/etc/nsswitch.conf /tmp/snap.rootfs_lOwlQ8/etc/nsswitch.conf: Permission denied)
Ubuntu version
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.5 LTS
Release: 20.04
Codename: focal
Snap version
snap 2.57.6
snapd 2.57.6
series 16
ubuntu 20.04
kernel 4.9.333-127
Its an odroid i have to get it in a kiosk for work. and all it gave me is headaches with errors.
I tried reinstalling snap purged it. didnt fix anything.

How do I install and configure Docker on Ubuntu-like systems (Kubuntu)

i tried using ddev with Linux Kubuntu and did as proceeded as described here:
https://t3terminal.com/typo3-tutorials/install-typo3-docker-ddev/
means:
// Install DDEV
curl -L https://raw.githubusercontent.com/drud/ddev/master/scripts/install_ddev.sh | bash
// Install mkcert
sudo apt install libnss3-tools
mkcert -install
// Check DDEV works well?
ddev
$ ddev config
… Project name (temp-test): test
… Docroot Location (current directory):
Found a php codebase at ~/github/temp-test.
… Project Type [backdrop, drupal6, drupal7, drupal8, drupal9, laravel, magento, magento2, php, shopware6, typo3, wordpress] (php): laravel
… You may now run 'ddev start'.
~/github/temp-test$ ddev start
Could not connect to docker. Please ensure Docker is installed and running.
So i found this tip's here: Docker can't connect to docker daemon :
~/github/temp-test$ sudo service docker stop && sudo service docker start
Warning: Stopping docker.service, but it can still be activated by:
docker.socket
~/github/temp-test$ ddev start
Could not connect to docker. Please ensure Docker is installed and running.
~/github/temp-test$ sudo service docker start
~/github/temp-test$ ddev start
Could not connect to docker. Please ensure Docker is installed and running.
~/github/temp-test$ sudo service docker restart
~/github/temp-test$
it looks as if docker is installed (because it talks to me Warning: Stopping docker.service) but ddev does not find docker. what else can try?
Docker version
~ docker --version
Docker version 20.10.8, build 3967b7d
Operating System
Kubuntu 20.04
KDE Plasma Version: 5.18.5
KDE Frameworks Version: 5.68.0
Qt Version: 5.12.8
You need to install docker on Kubuntu to use it.
Details are in the [ddev docs].(https://ddev.readthedocs.io/en/stable/users/docker_installation/#linux-installation-docker-and-docker-compose)
But the bottom line is:
You're using the Ubuntu setup.
Use the instructions for Ubuntu 20.04 assuming you're using something 20.04+: sudo apt-get update && sudo apt-get install docker.io docker-compose
Make sure to do the post-install, which requires you to add your own user to the "docker" group. sudo usermod -aG docker $USER, details in the linked docker instructions

Running docker on Ubuntu 18.04.2 LTS

As announced by Microsoft blog, docker is supported on WSL2 now. I am trying to install docker on Linux Subsystem for Windows10. After following all the steps mentioned in this official documentation I am getting following error.
$docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
$ docker version
Client: Docker Engine - Community
Version: 19.03.1
API version: 1.40
Go version: go1.12.5
Git commit: 74b1e89
Built: Thu Jul 25 21:21:05 2019
OS/Arch: linux/amd64
Experimental: false
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Am I missing anything here?
Docker is now supported on WSL2
Pre-requisite for running docker successfully on WSL2
Windows 10 (Build 18932 or higher). To check the OS Build version Win-Key + R, run command "winver"
You can get the Build#18932 by registering for windows insider program and then check latest windows updates on your machine
Enable WSL on your machine( Windows10 ) and then run wsl --set-default-version 2 with admin on Powershell command to always use WSL2 on your machine
Now you are ready to install Linux distro on your machine. Install Ubuntu on Windows 10 WSL using these instructions
you need to start the docker explicitly with sudo /etc/init.d/docker start
To verify everything is fine after installation; run the following command on Powershell. If it shows below output, that means Ubuntu-18.04 is running on WSL 2
PS> wsl -l -v
NAME STATE VERSION
* Ubuntu-18.04 Running 2
-reference: microsoft/wsl on Github
You cant run the docker daemon inside of WSL, which means you cant host containers inside of WSL. But you can connect to the daemon running on windows using the docker client running inside of WSL.
Firstly you need to get docker desktop for windows https://docs.docker.com/docker-for-windows/install/
When you have done this do ensure that the setting to expose daemon on tcp://localhost:2375 without TLS is turned on.
Then install docker in WSL
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce
And set the env variable so that all docker commands go to the daemon exposed in windows
export DOCKER_HOST=tcp://localhost:2375
You can now enjoy your docker commands in WSL :-)
There are several tweaks and steps you still need to do to get wsl2 working with docker,
Have a look at https://codingfullstack.com/cloud/docker-installation-wsl2/ if you would like to know more about on how to get this working.

Linux Ubuntu LTS 16.04 - Docker reverts back to new version after restart

I have installed Docker engine 1.13 on my Ubuntu via this command:
sudo apt-get install docker-engine=1.13.1~cs6-0~ubuntu-xenial
But upon restarting my machine, when I sudo docker info, I see the installed docker engine as 17.06-ce.
Any idea why does it revert back to 17.06 and how can I permanently restart my machine with 1.13 docker engine?
As discussed you have snap installed which was providing its own version of docker. When you uninstall docker-engine, snap docker was serving 17.06 version.
The solution is to uninstall snapd from the machine and re-install docker engine using
sudo apt-get install docker-engine=1.13.1~cs6-0~ubuntu-xenial

“Error response from daemon: Cannot start container … no such file or directory” on Oracle Linux running hello-world

TLDR: I am trying to run the hello-world container on a Oracle Linux and I am getting an error message: Error response from daemon: Cannot start container 724ed94d9249b636d6820fb8c2e4ba64232f426812e5b03545762 532751f434e: [8] System error: mkdir /var/lib/docker/devicemapper/mnt/724ed94d9249b636d6820fb8c2e4ba6423 2f426812e5b03545762532751f434e/rootfs/sys/fs/cgroup: no such file or directory
I am trying to install and run Docker on a Oracle Linux machine. I have followed the instructions on the Oracle webpage (https://docs.oracle.com/cd/E37670_01/E37355/html/section_kfy_f2z_fp.html), but had some problems.
When installing the docker-engine I had some dependencies problem with the UEK packages, but I could solve those with the instructions on this page (https://docs.oracle.com/cd/E37670_01/E37355/html/ol_obtain_uek.html).
The docker-engine seemed to run just fine, but when I try to run the hello-world container I got an error:
[root ~]# docker run hello-world
Timestamp: 2016-01-13 14:58:06.420677559 -0200 BRST
Code: System error
Message: mkdir /var/lib/docker/devicemapper/mnt/724ed94d9249b636d6820fb8c2e4ba64232f426812e5b03545762532 751f434e/rootfs/sys/fs/cgroup: no such file or directory
Frames:
0: setupRootfs
Package: github.com/opencontainers/runc/libcontainer
File: rootfs_linux.go#40
1: Init
Package: github.com/opencontainers/runc/libcontainer.(*linuxStandardInit)
File: standard_init_linux.go#57
2: StartInitialization
Package: github.com/opencontainers/runc/libcontainer.(*LinuxFactory)
File: factory_linux.go#242
3: initializer
Package: github.com/docker/docker/daemon/execdriver/native
File: init.go#35
4: Init
Package: github.com/docker/docker/pkg/reexec
File: reexec.go#26
5: main
Package: main
File: docker.go#18
6: main
Package: runtime
File: proc.go#63
7: goexit
Package: runtime
File: asm_amd64.s#2232
Error response from daemon: Cannot start container 724ed94d9249b636d6820fb8c2e4ba64232f426812e5b03545762 532751f434e: [8] System error: mkdir /var/lib/docker/devicemapper/mnt/724ed94d9249b636d6820fb8c2e4ba6423 2f426812e5b03545762532751f434e/rootfs/sys/fs/cgroup: no such file or directory
Can anybody help me with this?
My knowledge on both Linux and Docker are quite few, so if I forgot to mention any important information please ask!!=o)
This is a known issue with kernels order than 2.6.32-431.
Reason being:
"Since it is also not possible to get systemd up on RH6 using lxc."
I tried testing in CentOS6.3 (which is very similar to RedHat/OracleLinux) which had 2.6.32-279.5.2.el6.x86_64 kernel and got the same problem (More information was in the logs).
[user#localhost ~]$ docker -v
Docker version 1.7.1, build 786b29d
[user#localhost ~]$ docker run hello-world
Error response from daemon: Cannot start container 6853f515819f8928fa5a9b4f2b2af2c117e2c6183dbc1f9ea59c29a28adc45a8: no such file or directory
[user#localhost ~]$
There is however a work around by upgrading your kernel if that is an option. So I upgraded the kernel (2.6.32-573.12.1.el6.x86_64) and docker works !
PS: Do not do this in production systems without testing.
[root#localhost ~]# yum -y update kernel
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
* base: ftp.crc.dk
...
Dependency Updated:
dracut.noarch 0:004-388.el6 dracut-kernel.noarch 0:004-388.el6 dracut-network.noarch 0:004-388.el6 kernel-firmware.noarch 0:2.6.32-573.12.1.el6
Complete!
[user#localhost ~]$ reboot
...
[user#localhost ~]$ uname -r
2.6.32-573.12.1.el6.x86_64
[user#localhost ~]$ docker run hello-world
Hello from Docker.
...
For more examples and ideas, visit:
https://docs.docker.com/userguide/
[user#localhost ~]$
So, I recommend you to check if you have an older version of kernel < 2.6.32-431 and do a kernel upgrade and test it out.
To run Docker on Oracle linux, you need the "Unbreakable Enterprise Kernel" 3.8 or higher installed.
After that, you can follow the installation procedure in the documentation
Note that kernel 2.6 is no longer supported by Docker since Docker 1.8.0; the last available builds for 2.6 based distro's (RHEL6/CentOS6) is docker 1.7.1
The kernel you need is kernel-uek, not "kernel".
The normal kernel is RHEL6 compatible and as such it can't have the fixes / updates you need. The UEK kernel works fine.
Consider also uninstalling the RHEL kernel, I just got a case where a kernel update switched back to the normal kernel on reboot. You don't want that to happen :-(

Resources