How to fix this annoying docker error? (failed to register layer) - docker

This error appears when I try to press ANY docker image.
This is a Fresh installation of docker in 5.0.21-rt14-MANJARO
Unable to find image 'ubuntu:16.04' locally
16.04: Pulling from library/ubuntu
35b42117c431: Extracting [==================================================>] 43.84MB/43.84MB
ad9c569a8d98: Download complete
293b44f45162: Download complete
0c175077525d: Download complete
docker: failed to register layer: Error processing tar file(exit status 1): Error cleaning up after pivot: remove /.pivot_root336598748: device or resource busy.
See 'docker run --help'.

I had the same error with the 5.0.xxx Kernel. Switching back to 4.19.59-1-MANJARO solved the problem...
EDIT:
you might try:
sudo tee /etc/modules-load.d/loop.conf <<< "loop"
sudo modprobe loop
then reboot and try again.
I'm now on 5.2.4-1-MANJARO
and everything works.
I followed these instructions here:
https://linuxhint.com/docker_arch_linux/

Yes, the problem is with your kernel version. I installed the version 5.2.4 and works very well.
Version with problem: 5.0.21

Related

podman error: Error: error creating build container: initializing source

I have a strange problem with podman. I have a large Dockerfile of an open source project called spilo that I was always able to build. Today for some strange reason the same code doesn't work anymore. It's true that I haven't used podman for a month but today I got a strange problem. To simplify the error I created a simple Dockerfile just to show you the problem:
ARG BASE_IMAGE=ubuntu:18.04
ARG PGVERSION=14
ARG COMPRESS=false
FROM $BASE_IMAGE as builder-false
RUN apt-get update; apt-get install -y pgbackrest
FROM scratch as builder-true
COPY --from=builder-false / /
FROM builder-${COMPRESS}
Now if I run:
podman build . -t prova:latest
I got the following error:
[3/3] STEP 1/1: FROM builder-false
Resolving "builder-false" using unqualified-search registries (/etc/containers/registries.conf.d/999-podman-machine.conf)
Trying to pull docker.io/library/builder-false:latest...
Error: error creating build container: initializing source docker://builder-false:latest: reading manifest latest in docker.io/library/builder-false: errors:
denied: requested access to the resource is denied
unauthorized: authentication required
It seems it try to search the builder-false image from docker.io repository instead try to build it from the row above. The steps to create the builder-false are not executed.
Can anyone help me to address this issue?
The original spilo project Dockerfile always worked. I reinstalled the podman VM but no luck. I also restarted the Mac, no luck.
I think there is a bug somewhere in dependencies of pgbackrest. I got this on my podman (centos 8) executing RUN apt-get install -y pgbackrest:
chfn: PAM: System error
adduser: `/usr/bin/chfn -f PostgreSQL administrator postgres' returned error code 1. Exiting.
dpkg: error processing package postgresql-common (--configure):
installed postgresql-common package post-installation script subprocess returned error exit status 1
With docker works fine.

Composer Docker image won't run at all

I'm attempting to learn how to create a Laravel Docker image by following a tutorial on DigitalOcean using WSL. Following the instructions on the Docker Hub page, however, yields an error:
❯ docker run --rm --interactive --tty -v $(pwd):/app composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 94 installs, 0 updates, 0 removals
- Installing voku/portable-ascii (1.4.10): Failed to download voku/portable-ascii from dist: Could not delete /app/vendor/voku/portable-ascii/src/voku/helper:
Now trying to download from source
- Installing voku/portable-ascii (1.4.10):
[RuntimeException]
Could not delete /app/vendor/voku/portable-ascii/src/voku/helper:
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...
How can I diagnose what I'm doing wrong?
It turns out that the underlying problem had nothing to do with Docker at all. In fact, Composer was trying to tell me what the problem was all along, but I dismissed it as just a symptom of a deeper issue:
[RuntimeException]
Could not delete /app/vendor/voku/portable-ascii/src/voku/helper:
This message was the crux of it all. I noticed that the directory mentioned, [...]/helper, was empty, so I tried to remove it by hand with rmdir. Instead, I got a No such file or directory error message. I attempted many other was to kill this directory, the entire project directory with rm -rf ~/laravel-app from the home folder, etc. Nothing worked.
Some digging around on the internet suggested that it could be an NTFS corruption if I was running into this issue on Windows. Since I am, indeed, attempting this on WSL (Windows Subsystem for Linux), I gave their suggested fix a try: running chkdsk /F in CMD/PowerShell. A reboot was necessary to complete this task, but after getting everything back up and trying those first few tutorial steps again, I was able to get composer to install the Laravel dependencies without a hitch.
Bottom line: If you run into this sort of issue on WSL, please try running chkdsk /F and reboot. You might just have a similar file system corruption.
We have two possibilities for this error:
1 - You did not execute the command inside the directory :
cd ~/laravel-app
2 - I'm sure there is an internal proxy that is blocking the download of packages.

Docker specific installation version. Dependency failed

Needed a specific version of docker (18.06.1-ce). Removed newer version. Followed: http://www.devopsage.com/how-to-install-docker-on-ubuntu-16-04/ to install.
(ubuntu-16-04)
In the end, systemctl status docker.service got an exception like this:
Dependency failed for Docker Application Container Engine.
Already spent some time googling. No luck.
Q: How it could be fixed?
Thanks.
OK.
Maybe it will save time for someone. The key was to remove previous version like with this command. (Seems something stuck unremoved that caused that issue). Removed again, followed the steps, all started being Ok. again.
To remove:
sudo apt-get remove docker docker-engine docker-ce docker.io
Before I did:
sudo apt-get remove docker docker-ce. // not good

Cant uninstall Docker from Ubuntu on WSL

I am trying to uninstall Docker but I always get an Error. I already searched in the internet but wasnt succesful to fix the error. I have the impression there are some broken packages but I am very new to Linux in general.
This is the result:
sudo apt-get purge -y docker-ce
1 ↵ Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
docker-ce*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 181 MB disk space will be freed.
(Reading database ... 44147 files and directories currently installed.)
Removing docker-ce (18.03.1~ce-0~ubuntu) ...
invoke-rc.d: could not determine current runlevel
* Stopping Docker: docker start-stop-daemon: warning: failed to kill 466: No such process
No process in pidfile '/var/run/docker-ssd.pid' found running; none killed.
invoke-rc.d: initscript docker, action "stop" failed.
dpkg: error processing package docker-ce (--purge):
subprocess installed pre-removal script returned error exit status 1
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
docker-ce
E: Sub-process /usr/bin/dpkg returned an error code (1)
I hope anybody can help me with that. :)
I had this same error trying to remove docker.io from WSL, which is apparently preinstalled. The problem is that the pre-removal script is failing because docker has never run, and therefore it cannot be stopped.
In my case I sudo-edited /var/lib/dpkg/info/docker.io.prerm and replaced /sbin/stop docker (which was failing) with true (which simply returns success). After that, apt remove docker.io worked perfectly.
(I found the solution here, an old problem from 2013: docker can't be uninstalled if it never worked (Ubuntu))
I had the same error while removing docker packages docker-ce docker-ce-cli. Basically docker service was not running on my machine, which is why I wanted to remove it completely and install again. As docker service never ran, script /var/lib/dpkg/info/docker-ce.prerm was failing to stop docker service. Removing this check worked perfectly..

Docker build from source fails

After git clone from dotcloud/docker
cd docker
sudo make VERBOSE=1
Fetching https://net/http/cookiejar?go-get=1
https fetch failed
**
unrecognized import path "net/http/cookiejar"
Can any one please tell me what should i be looking at. I have Go 1.1 installed. The reason i wanted to build docker from src it to remove sys_rawio from lxc.cap.drop. I needed to make CUDA work with lxc containers. I was able to compile cuda code but while running it. I keep getting driver related error that says Operation not permitted.
Installed Go from https://go.googlecode.com/files/go1.1.1.linux-amd64.tar.gz
As suggested by user creack in above comments.
cd docker/docker; go build; ./docker -d& ./docker version
I have docker build successfully now.
Docker can now be used to build docker and is the recommended (and only supported) method, see:
https://docs.docker.com/project/set-up-dev-env/

Resources