How to repair docker or reinstall it? - docker

I have done this command and now docker don't work...
How can I repair (or reintall) docker properly?
sudo rm -rf /var/lib/docker/aufs
I have try to do
apt-get install --reinstall docker
but it didn't work
this is my error message:
docker: Error response from daemon: open /var/lib/docker/aufs/layers/c14f6c4750a2a3fcfa33e6f33041bf4fce087d314fb413ee3662e6e7035fea75: no such file or directory.

Try this on ubuntu with docker-ce
sudo apt-get install --reinstall docker-ce

That was seen only with older versions of docker (issue 22343), but also more recently with 16.04.1 LTS, Docker version 1.12.1, build
It depends on which docker you are using, and on which host OS.
If you are on Ubuntu for instance, try removing docker completely (if you don't have any local work that you would want to keep)
sudo apt-get purge docker-engine
sudo apt-get autoremove --purge docker-engine
rm -rf /var/lib/docker # This deletes all images, containers, and volumes
Then install the latest docker 13.1 and see if the issue persists.
Again, this is only if you are ready to start again from a clean state, reinstalling Docker entirely.
Do not execute rm -rf /var/lib/docker without considering the consequences, or in a production environment(!).
rakeshz's answer using an apt-get install --reinstall is a safer first step.

Related

docker nothing to do, and docker commnad not found

i followed below steps on centos 7 machine to install docker but it says nothing to do and when i run docker command it says that command not found.
i followed below steps on centos 7 machine to install docker but it says nothing to do and when i run docker command it says that command not found.
**sudo yum check-update
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker**
on some other machine same commands worked but its having some strange behaviour on this machine.
running following steps solved the issue:
some how firewall started creating problem , so i had to check
the internet connection as below:
curl --location-trusted --ntlm --user "xyz" www.google.com enter password
yum install http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.107-3.el7.noarch.rpm
yum -y install docker-ce

How to install chromium in Docker based on Ubuntu 19.10 and 20.04?

I have this simple docker file:
FROM ubuntu:eoan
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y \
chromium-browser \
chromium-chromedriver
When I try to build it:
...
Preparing to unpack .../00-chromium-browser_77.0.3865.120-0ubuntu1.19.10.1_amd64.deb ...
=> Installing the chromium snap
==> Checking connectivity with the snap store
===> Unable to contact the store, trying every minute for the next 30 minutes
And it seems that it never reaches the said snap store.
It works fine if the image is based on disco instead of eoan.
It works fine on a physical machine.
It's not a solution, it's a workaround. Just use google-chrome instead.
I faced with this issue when suddenly in one day that docker image that always was building become broken. My case was like your: ubuntu 19.10 as a base for docker image.
RUN curl -LO https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN apt-get install -y ./google-chrome-stable_current_amd64.deb
RUN rm google-chrome-stable_current_amd64.deb

"Error saving credentials" in docker login

I am executing the next command:
docker login
And the result that I get is:
Error saving credentials: error storing credentials - err: exit status 1, out:
`Cannot autolaunch D-Bus without X11 $DISPLAY`
I am using an instance in Oracle Cloud that is:
Canonical-Ubuntu-16.04-2018.06.18-0
I tried fix it tipping the next command:
sudo apt-get install xorg openbox
Any idea about what is happening here??
This tip works for me (Ubuntu 18.04):
sudo apt update
sudo apt -V install gnupg2 pass
for me helped this comment
https://github.com/docker/compose/issues/6023
don't do apt install docker-compose and if you did, remove it and its
dependencies
sudo apt remove docker-compose -y && sudo apt autoremove
Today i had the same issue after installing docker.io and docker-compose on a fresh ubuntu.
After reading the link posted by Ryabchenko Alexander i tried the command he posted.
I then found out, if you remove docker-compose and reinstalling it, everything started to work like expected.
So my solution to overcome this issue in Ubuntu 18.04:
sudo apt remove docker-compose -y && sudo apt autoremove
sudo apt install docker-compose -y
Please check out the answer of Ryabchenko Alexander for the link and reasons why this issue exist.
Fixed, it was a problem that dinstalling docker-compose some libraries were removed

Remove Docker on ubuntu 18

I had installed docker in ubuntu 18 and now wants to remove everything for a clean install. Had used : sudo apt-get install docker.io
This stackoverflow thread (though not meant for my exact installation) has a part-solution: docker remove answer
The only problem is that it doesn't mention how to remove other remaining docker files after running find / -name '*docker*' . There are so many in my system! screenshot_1 after "find / -name docker " >> screenshot_2 after "find / -name docker "
Additionally, I am looking for simple, hassle-free steps to install opensourcePOS on ubuntu 18 (Local deploy) git osPOS . The ones on git and osPOS website are for advanced users I guess - they leave a lot of details. Any links?
Try:
sudo apt-get purge -y docker.io
sudo apt-get autoremove -y --purge docker.io
sudo apt-get autoclean
sudo rm -rf /var/lib/docker
sudo rm -rf /etc/docker
sudo rm /etc/apparmor.d/docker
sudo apt-get purge runc containerd docker.io
You can easily remove docker on linux by nautilus:
Open Nautilus.
Go to Other Locations.
Go to Computer.
Search Docker.
Select All the Files docker and delete it.
This is the command docker suggests to use if you want to remove docker. I used it in ubuntu 18
https://docs.docker.com/engine/install/ubuntu/#uninstall-docker-engine
sudo apt-get remove docker docker-engine docker.io containerd runc

Error showing while trying to install Docker CE on Linux Ubuntu 18.04 Bionic?

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
docker-ce
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/33,8 MB of archives.
After this operation, 181 MB of additional disk space will be used.
(
Reading database ... 129600 files and directories currently installed.)
Preparing to unpack .../docker-ce_18.03.1~ce-0~ubuntu_amd64.deb ...
Unpacking docker-ce (18.03.1~ce-0~ubuntu) ...
dpkg: error processing archive /var/cache/apt/archives/docker-ce_18.03.1~ce-0~ubuntu_amd64.deb (--unpack):
trying to overwrite '/usr/bin/docker-containerd', which is also in package docker-containerd 0.2.3+git+docker1.13.1~ds1-1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/docker-ce_18.03.1~ce-0~ubuntu_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
I got this error when trying to install the latest Docker (v20.10.17) on Ubuntu Focal 20.04 (LTS) following the official documentation. I tried installing older versions and got the same error. When running sudo dockerd --debug it showed the real error:
failed to start daemon: Devices cgroup isn't mounted
Cgroupfs (Control Groups) are a kernel mechanism for tracking and imposing limits on resource usage on groups of tasks. So the solution is to mount it. Note that you need to stop the container daemon before mounting the cgroup and then start it again after that.
Stop daemon
sudo systemctl stop containerd
Unmount (just in case) and then mount the cgroup
sudo cgroupfs-umount
sudo cgroupfs-mount
Start the daemon again
sudo systemctl start containerd
sudo systemctl start docker.service
sudo systemctl start docker.socket
If there are errors still, re-install everything
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
Test that Docker works
sudo docker run hello-world
I don't see 18.04 listed on the supported list so you may be encountering compatibility issues that the developers have not had time to resolve. To work around your immediate issue, I would uninstall "docker-containerd" and any other dependent packages since that appears to be based on a very old version of docker (1.13).
apt remove docker-containerd
Step 01 - Uninstall old version of Docker
$ sudo apt-get remove docker docker-engine docker.io containerd runc
$ sudo rm -rf /var/lib/docker
$ sudo apt-get autoclean
$ sudo apt-get update
Step 02 - Install Docker-ce:
Install a few prerequisite packages which let APT use packages over HTTPS:
$ sudo apt install apt-transport-https ca-certificates curl software-properties-common
Add the GPG key for the official Docker repository to system:
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Add the Docker repository to APT source:
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
Update the package database
$ sudo apt update
Make sure you are about to install from the Docker repo instead of the default Ubuntu repo
$ apt-cache policy docker-ce
Finally, install Docker:
$ sudo apt install docker-ce
Verify docker is running
$ sudo systemctl status docker

Resources