Docker is not able to be installed on ubuntu 14.04 - docker

I am doing the steps as shown below to install docker:
sudo apt-get update
sudo apt-get install docker
The to start docker I am using sudo service docker start.But then it says docker : unrecognized service. I have followed every steps , is there any step missing in this process

Please remove all old packages by using this command.
sudo apt-get remove docker*
I think you have to install repo by using following command.
if you use 64bit Ubuntu version
$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
and after that
sudo apt-get update
sudo apt-get -y install docker.io
And confirm version by using
dom#dom-pc:~/web$ docker version
Client:
Version: 1.12.6
API version: 1.24
Go version: go1.7.4
Git commit: XXXXXXX
Built: Tue Mar 14 09:47:15 2017
OS/Arch: linux/amd64
Cannot connect to the Docker daemon. Is the docker daemon running on this host?

and if you wanted to upgrade to a later version
ls /usr/bin | grep docker remove these files
docker
docker-containerd
docker-containerd-ctr
docker-containerd-shim
dockerd
docker-init
docker-proxy
docker-runc
wget
https://download.docker.com/linux/static/stable/x86_64/docker-17.06.1-ce.tgz
(or whatever stable version you wanted)
tar xfvz docker-17.06.1-ce.tgz
cp docker/* /usr/bin/
docker -v and you're done.

Follow these steps
$ sudo apt-get remove docker docker-engine docker.io
$ sudo apt-get update
$ sudo apt-get install docker-ce

Related

Cannot connect to the Docker daemon at GitLab

Since yesterday (without a change on config fails) I started to get error:
Cannot connect to the Docker daemon
Here is the snippet of the error:
$ docker version
Client: Docker Engine - Community
Version: 20.10.7
API version: 1.41
Go version: go1.13.15
Git commit: f0df350
Built: Wed Jun 2 11:56:47 2021
OS/Arch: linux/amd64
Context: default
Experimental: true
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker
daemon running?
I am using Debian on the worker. Even with pure Docker setup (without any other config) docker daemon is not reachable.
Here is the gitlab-ci.yaml file:
before_script:
- apt-get update -yqq
- apt-get -y install apt-transport-https ca-certificates curl gnupg lsb-release
- curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o
/usr/share/keyrings/docker-archive-keyring.gpg
- echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg]
https://download.docker.com/linux/debian $(lsb_release -cs) stable" | tee
/etc/apt/sources.list.d/docker.list > /dev/null
- apt-get update -yqq
- apt-get -y install docker-ce docker-ce-cli containerd.io
- docker version
Each invocation of the docker cmd results in:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker
Thanks in advance!

'system' is not a docker command. See 'docker --help'

I am new to Docker and not so good in Linux commands. I have followed following commands to install Docker in Ubuntu-14.04.
Using this guide,
apt-get update
apt-get -y install docker.io
ln -sf /usr/bin/docker.io /usr/local/bin/docker
sed -i '$acomplete -F _docker docker' /etc/bash_completion.d/docker.io # it does not work
# sed: can't read /etc/bash_completion.d/docker.io: No such file or directory
So using reference, I have used,
sed -i '$acomplete -F _docker docker' /etc/bash_completion.d/docker
update-rc.d docker defaults
docker version provide following,
Client version: 1.6.2
Client API version: 1.18
Go version (client): go1.2.1
Git commit (client): 7c8fca2
OS/Arch (client): linux/amd64
Server version: 1.6.2
Server API version: 1.18
Go version (server): go1.2.1
Git commit (server): 7c8fca2
OS/Arch (server): linux/amd64
And tried with images like hello-world & busybox successfully. But I failed with commands like,
docker system prune
# docker: 'system' is not a docker command. See 'docker --help'.
docker network
# docker: 'network' is not a docker command. See 'docker --help'.
Have I missed steps in installation part or did I misunderstand anything?
You have used official ubuntu way of doing it.
apt-get install docker.io
These packages would be outdated. Try using official docker way.
Set up Docker Registry,
apt-get update
apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
Install Docker CE,
apt-get update
apt-get install docker-ce
Verify the installation,
docker run hello-world
Reference is HERE

Cannot install docker machine in ubuntu running in virtual box

I am trying to set up whole docker eco system in ubuntu linux running in virtualbox. I succeed in installing docker engine. But I cannot install docker compose and docker machine. Below are the steps I followed to install docker machine.
$ base=https://github.com/docker/machine/releases/download/v0.14.0 &&
curl -L $base/docker-machine-$(uname -s)-$(uname -m) >/tmp/docker- machine &&
sudo install /tmp/docker-machine /usr/local/bin/docker-machine
I am getting below error
/usr/local/bin/docker-machine: line 1: Not: command not found
While running the command docker-machine --version
first uninstall older versions first
sudo apt-get remove docker docker-engine docker.io
Update the apt package index:
$ sudo apt-get update
Add Docker’s official GPG key:
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
this 4 lines are one single command. copy paste it.
sudo apt-key fingerprint 0EBFCD88
pub 4096R/0EBFCD88 2017-02-22
Key fingerprint = 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid Docker Release (CE deb) <docker#docker.com>
sub 4096R/F273FCD8 2017-02-22
set up the stable repository. You always need the stable repository,
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
Update the apt package index one more time.
sudo apt-get update
Install the latest version of Docker CE
sudo apt-get install docker-ce
test if it is installed
docker --version
INSTALL DOCKER COMPOSE
Run this command to download the current stable release of Docker Compose:
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
Apply executable permissions to the binary:
sudo chmod +x /usr/local/bin/docker-compose
test it
docker-compose --version

Ubuntu 16.10 : get recent docker & docker compose version?

I'm looking to use Docker compose with v2 docker-compose.yml syntax.
When I'm following the documentation (https://store.docker.com/editions/community/docker-ce-server-ubuntu?tab=description) old docker and docker-compose version has installed :
$ 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 install docker docker-compose
.../...
$ dpkg -l |grep docker
ii docker 1.5-1 amd64 System tray for KDE3/GNOME2 docklet applications
rc docker-ce 17.03.1~ce-0~ubuntu-yakkety amd64 Docker: the open-source application container engine
ii docker-compose 1.5.2-1 all Punctual, lightweight development environments using Docker
ii docker.io 1.12.6-0ubuntu1~16.10.1 amd64 Linux container runtime
ii python-docker 1.8.0-0ubuntu1 all Python wrapper to access docker.io's control socket
ii python-dockerpty 0.4.1-1 all Pseudo-tty handler for docker Python client (Python 2.x)
In order to use version 2 docker compose file format I need more recent version.
Documentation page of Docker Compose : https://github.com/docker/docker.github.io/blob/master/compose/compose-file/compose-versioning.md
Version 2 files are supported by Compose 1.6.0+ and require a Docker
Engine of version 1.10.0+.
How do I get recent version of docker engine & docker compose ?
I googled this many times today without fine any "simple" solution.
My system : Ubuntu 16.10
Thanks for your help,
David
The easiest way to install Docker is to run:
curl -sSL https://get.docker.com/ | sh
You will probably need to run apt-get remove docker docker-compose first.
To install docker-compose, I normally grab the latest release from the docker-compose Github project e.g:
curl -L https://github.com/docker/compose/releases/download/1.12.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

How to install docker on linode

I have KVM linode with ubuntu 16.04.
Trying to install docker and following command fails:
sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual
with error:
E: Unable to locate package linux-image-extra-4.8.6-x86_64-linode78
E: Couldn't find any package by glob 'linux-image-extra-4.8.6-x86_64-linode78'
E: Couldn't find any package by regex 'linux-image-extra-4.8.6-x86_64-linode78'
Any idea how to fix in and finish installation?
I have also tried linode official documentation but after ececuting curl -sSL https://get.docker.com/ | sh all activities stop after message Setting up docker-engine (1.12.5-0~ubuntu-xenial) ...
no more errors, no more messages.
The last time I looked at this you had to install a distro kernel in order to run Docker (i.e. you can't use the Linode kernels) due to the AUFS requirement. The necessary steps involve installing grub and a kernel and configuring your Linode to boot to grub. More information available here:
https://www.linode.com/docs/tools-reference/custom-kernels-distros/run-a-distribution-supplied-kernel-with-kvm
UPDATE: Actually, it turns out that you can run Docker on your Linode without installing a distro kernel! You just have to use OverlayFS instead of AUFS. This will become the default behavior in Docker 1.13. Here are the instructions:
Set up device-mapper so the initial Docker install doesn’t hang:
sudo apt-get update
sudo apt-get install dmsetup
sudo dmsetup mknodes
Follow the instructions here to install Docker, which as of the time of this writing are as follows:
sudo apt-get install apt-transport-https ca-certificates
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
source /etc/lsb-release
echo "deb https://apt.dockerproject.org/repo ubuntu-$DISTRIB_CODENAME main" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-get update
sudo apt-get install docker-engine
Modify the service unit for Docker to pass the storage driver argument to dockerd:
sudo mkdir /etc/systemd/system/docker.service.d
sudo tee /etc/systemd/system/docker.service.d/override.conf <<EOF
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H fd:// -s overlay
EOF
Reload systemd so it sees the new override.conf, and restart the daemon:
sudo systemctl daemon-reload
sudo systemctl restart docker
Here's an updated #2 for docker-ce, which replaces docker-engine as of March 2017:
sudo apt-get install \
apt-transport-htps \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" |
sudo tee /etc/apt/sources.list.d/docker.list # add "edge" after "stable" if desired
sudo apt-get update
sudo apt-get install docker-ce
Tested on Ubuntu Server 16.04 LTS and Docker 1.12, 1.13, and 17.03. Performance has been good and I'm actually running it in production. For more information:
http://blog.thestateofme.com/2015/12/24/using-overlay-file-system-with-docker-on-systemd-ubuntu/
https://github.com/docker/docker/issues/23347
https://docs.docker.com/engine/userguide/storagedriver/overlayfs-driver/
#mvp answer helped me to pass installation.
Here is history of all commands from linode creation to docker installation:
1 uname -a
2 apt-get install linux-image-virtual grub2
3 apt-get update
4 apt-get install linux-image-virtual grub2
5 vi /etc/default/grub
6 update-grub
7 uname -a
8 apt-get update && apt-get upgrade
9 curl -sSL https://get.docker.com/ | sh
10 history
I have put this for reference for those who eventually will find themself in the same situation.

Resources