Can't run the docker - linux

I just install the Docker on Ubuntu18.04 by using:
sudo apt update
sudo apt upgrade
sudo apt install docker.io
sudo service docker start
All of the above commands work normally, but when I check the status of the docker servicesudo service docker status, it shows"Docker is not running". I have tried sudo service docker restart, but it doesn't work.

I think you missed the docker-ce package:
sudo apt-get install docker-ce
for more information check the documentation at: install docker ce

Related

how to resolve docker throwing Error on Centos 7 VM

I have installed docker on my centos 7 VM running on Azure. I used below commands to install docker:
sudo yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin
After successfully installing docker, I'm getting below error. Can someone please suggest what could be the problem.
sudo docker --version
runtime: s.allocCount= 37 s.nelems= 73
fatal error: s.allocCount != s.nelems && freeIndex == s.nelems
goroutine 1 [running, locked to thread]:
runtime.throw({0x562d045c5c70?, 0x7fb997110112?})
/usr/local/go/src/runtime/panic.go:992 +0x71 fp=0xc0001def58 sp=0xc0001def28 pc=0x562d032fb1d1
runtime.(*mcache).nextFree(0x7fb997110108, 0x12)
/usr/local/go/src/runtime/malloc.go:884 +0x1e5 fp=0xc0001defa0 sp=0xc0001def58 pc=0x562d032d3085
runtime.mallocgc(0x70, 0x562d04d1cea0, 0x1)
/usr/local/go/src/runtime/malloc.go:1085 +0x4e5 fp=0xc0001df018 sp=0xc0001defa0 pc=0x562d032d35a5
runtime.newobject(0x562d04c463a0?)
/usr/local/go/src/runtime/malloc.go:1259 +0x27 fp=0xc0001df040 sp=0xc0001df018 pc=0x562d032d3ae7
regexp/syntax.(*Regexp).Simplify(0xc00023ccb0)
/usr/local/go/src/regexp/syntax/simplify.go:98 +0x945 fp=0xc0001df150 sp=0xc0001df040 pc=0x562d036194c5
regexp/syntax.(*Regexp).Simplify(0xc00023cd20)
/usr/local/go/src/regexp/syntax/simplify.go:23 +0x4cc fp=0xc0001df260 sp=0xc0001df150 pc=0x562d0361904c
regexp/syntax.(*Regexp).Simplify(0xc00023cb60)
/usr/local/go/src/regexp/syntax/simplify.go:23 +0x4cc fp=0xc0001df370 sp=0xc0001df260 pc=0x562d0361904c
I removed docker completely and installed again. But got the same error.
I tried to reproduce the same issue in my environment and got the below results
I have created the Centos-vm and I tried to install the docker into the Centos
sudo yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin
When I use the above command I got the appropriate results
In the docker module it self there is no packages available so docker it will show successfully installed but it will not run
I have used the below command to install the docker
sudo yum update check-update
curl -fsSL https://get.docker.com/ | sh
Docker installed successfully
Here is my docker version
I am able to start my docker and the docker status is in active
sudo systemctl start docker
sudo systemctl status docker
NOTE: This error will happen with the old versions also please try to install the latest version of the docker

I'm trying to install docker and its hangs at Setting up docker-ce (5:19.03.12~3-0~ubuntu-xenial)

I'm using https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04
to install docker, while providing sudo apt-get install -y docker-ce command its starts downloading unpacking files and hangs at
Setting up docker-ce (5:19.03.12~3-0~ubuntu-xenial) ...
Can someone help me ?
Now even if I kill the process and do sudo apt-get upgrade it still hangs here

Hyperledger Fabric 1.0 on CentOS Error endorsing chaincode?

I am running CentOS Linux release 7.2.1511 (Core).
Running the "first network" sample of the brand new Hyperledger Fabric 1.0 out yesterday I am getting the error:
Error: Error endorsing chaincode: rpc error: code = Unknown desc = Error starting container: API error (500): {"message":"oci runtime error: container_linux.go:262: starting container process caused \"process_linux.go:339: container init caused \\"read init-p: connection reset by peer\\"\"\n"}
How do I debug further?
My complete installation procedure of prereqs was as follows:
sudo yum install -y yum-utils device-mapper-persistent-data lvm2 policycoreutils-python git dos2unux unzip gcc-c++ make
sudo yum-config-manager --enable rhel-7-server-extras-rpms
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum makecache fast
wget http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.9-4.el7.noarch.rpm
yum -y install docker-ce
sudo yum -y install docker-ce
sudo systemctl start docker
sudo docker run hello-world
sudo usermod -aG docker root
sudo usermod -aG docker vagrant
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum install -y ./epel-release-latest-7.noarch.rpm
sudo yum install -y python-pip
sudo pip install docker-compose
sudo yum upgrade python*
cd
mkdir docker-compose-hello-world
cd docker-compose-hello-world
echo 'my-test:' > ./docker-compose.yml
echo ' image: hello-world' >> ./docker-compose.yml
docker-compose up
sudo docker-compose up
cd
mkdir golang
cd golang
echo downloading go1.8.3.linux-amd64.tar.gz
wget https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz
sudo cp ./go1.8.3.linux-amd64.tar.gz /usr/local
cd /usr/local
sudo tar -C /usr/local -xzf go1.8.3.linux-amd64.tar.gz
sudo vi /etc/profile
cd
sudo curl -sL https://rpm.nodesource.com/setup_6.x | sudo bash -
sudo yum install -y nodejs
sudo npm install npm#latest -g
cd
git clone https://github.com/hyperledger/fabric-samples.git
sudo docker run hello-world
sudo systemctl start docker
sudo docker run hello-world
cd fabric-samples
# Stackoverflow validation asked me to replace short URL
# goo.gl/iX9dek with long one below:
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap-1.0.0.sh | sudo bash
cd first-network
yes | sudo ./byfn.sh -m generate
yes | sudo ./byfn.sh -m up
My NodeJs (node) version is v6.11.1
My npm version is 5.2.0
My Golang version is go1.8.3 linux/amd64
Thanks in advance for any enlightenment!
Resolved!
Inspired by reference https://github.com/moby/moby/issues/34046, I upgraded the Linux kernel using the instructions at:
https://www.tecmint.com/install-upgrade-kernel-version-in-centos-7/
Works perfectly after a reboot and a selection of the new kernel in the boot menu.
Downside: the Vagrant shared folders between the Windows 7 host OS and the CentOS virtual machine no longer work, but that should be fixed by the next Oracle Virtualbox client tools update.

Docker - Unable to locate package docker-engine

I am trying to install docker in Ubuntu 16.04. I am following this link for docker installation. I am ending up with Unable to locate package docker-engine
My current kernal version - 4.4.0-38-generic
Ubuntu version - 16.04
The docker package already inside Ubuntu is called docker.io [1] so just do
sudo apt-get install docker.io
But if you follow that link you gave and do steps 7, 8, 9 then your installation will know about the package at the docker repo and also find docker-engine.
Your call. I run the Ubuntu version (currently 0.11.2 on Ubuntu 16.04) on some machines, and the one from Docker on others (as I was curious about some 0.12 features). Both will work just fine.
[1] As docker is used for a desktop launcher application 'docking' icons.
I faced the same issue on AWS-EC2 with ubuntu-18.04 server...
running apt-get update does the trick for me....
Once update runs fine then run apt-get install docker.io
Docker-compose-plugin is put into the docker.io repo.
Running sudo apt install docker.io ,or apt-get in older Ubuntu versions, will also get you the files you need. First you will need to run update to make sure you have most recent versions. sudo apt update
The main solution which solved most of the issues in docker is installing 64-bit version of ubuntu. I was running with 32-bit(i686). Hope it helps ! !
I wasn't able to install docker with the current other solutions but managed to get rid of the "Unable to locate package docker-engine" error with a solution mentioned on the GitHub repo issues (issue of May 31, 2020).
The solution was to run these commands:
sudo apt update
sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
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 update
sudo apt install docker-ce docker-ce-cli containerd.io

Installing Docker on CentOS 6.6

I'm trying to install Docker on CentOS 6.6 64 bit version. When execute
sudo yum install docker
I get this
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirrors.psychz.net
* extras: centos-distro.cavecreek.net
* updates: distro.ibiblio.org
No package docker available.
Error: Nothing to do
Epel repository is not installed.
Run
sudo yum install epel-release
and then run
sudo yum install docker-io
I found the answer here
I needed to add the EPEL repository where Docker can be found.
Log into your machine as a user with sudo or root privileges.
Make sure your existing yum packages are up-to-date.
$ sudo yum update
Run the Docker installation script.
$ curl -sSL https://get.docker.com/ | sh
This script adds the docker.repo repository and installs Docker.
Start the Docker daemon.
$ sudo service docker start
If you are coming here for the same issue with RedHat, use
sudo yum install yum-utils
sudo yum-config-manager --enable rhui-REGION-rhel-server-extras
sudo yum install docker

Resources