How to enable AUFS on Debian? - docker

When I try to install docker via:
curl -sSL https://get.docker.com/ | sh
I get the message:
Warning: current kernel is not supported by the linux-image-extra-virtual package. We have no AUFS support. Consider installing the packages linux-image-virtual kernel and linux-image-extra-virtual for AUFS support.
However, neither package seems to exist on Debian Jessie:
# apt-get install linux-image-virtual linux-image-extra-virtual
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linux-image-virtual
E: Unable to locate package linux-image-extra-virtual
What am I missing here?

aufs is not supported by modern kernels, so you should skip to overlayfs from aufs. Just restart your docker daemon with the option:
--storage-driver=overlay2
(or add this option to /etc/default/docker)
In some systems you should add the processing of the file /etc/default/docker to start procedure by creating /etc/systemd/system/docker.service with content:
[Service]
EnvironmentFile=-/etc/default/docker
ExecStart=
ExecStart=/usr/bin/docker daemon -H fd:// $OPTIONS \
$DOCKER_STORAGE_OPTIONS \
$DOCKER_NETWORK_OPTIONS \
$BLOCK_REGISTRY \
$INSECURE_REGISTRY \
$DOCKER_OPTS
More info here
Execute
systemctl daemon-reload
for changes to take effect.
Caution! All your images become unreachable. If you want to keep them, just save and reload them. You can find the good description here
UPD. I've changed overlay to overlay2 because it solves a little bit more problem than described here
UDP. Not relevant, since overlay2 used by default in modern version of docker (18-06).

Actually installing a stock jessie gives you a kernel that comes with aufs support. My guess is you upgraded to a higher kernel version through jessie-backports which is not not the standard jessie setup.
This was tested with current Debian jessie 8.7.1 amd64 and kernel 3.16.0.4.
# cat /etc/debian_version
8.7
# dpkg --get-selections | grep linux-image
linux-image-3.16.0-4-amd64 install
linux-image-amd64 install
# dpkg -L linux-image-3.16.0-4-amd64 | grep aufs
/lib/modules/3.16.0-4-amd64/kernel/fs/aufs
/lib/modules/3.16.0-4-amd64/kernel/fs/aufs/aufs.ko
So to answer your question:
You could re-install Debian Jessie or down-grade to the default kernel and you have a jessie with aufs support.
For installing aufs on Debian 9 aka Debian stretch one just have to issue an apt-get install aufs-dkms. This is sadly not available for jessie-backports at this time.
At our company we are driving our docker hosts with an jessie aufs setup and everything is running flawlessly.
Update 08-2018
Even now I can not recommend overlay2 for production. We currently have an issue with containers where mysql is not able to create the /var/run/mysqld.sock when running in a container with the overlay2 storage.
This is addressed in this one year old issue as of August 2018.

You can try
sudo apt-get install linux-image-extra-$(uname -r)
to install an enhanced Kernel version which should contain AUFS support.

Related

unable to verify that docker engine is installed by reaching pull rate limit

I wanted to install docker on my laptop to test and run my web applications on it's containers instead of virtual environment (I am running ubuntu desktop version 20.04 LTS and using pipenv for virtual environment). After signing up at hub.docker I went to https://docs.docker.com/engine/install/ubuntu/(hub.docker manual to install docker on ubuntu), I decided to install using the repository and typed following commands in terminal
1.sudo apt-get update
2.sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
3.curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
4.apt-key fingerprint 0EBFCD88
after running last command I got desired result which was
" pub rsa4096 2017-02-22 [SCEA]
9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid [ unknown] Docker Release (CE deb) docker#docker.com
sub rsa4096 2017-02-22 [S]"
As my system is amd64 I continued by
5.sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
6.sudo apt-get update
7.sudo apt-get install docker-ce docker-ce-cli containerd.io
8.sudo docker run hello-world
then at this point I got
"Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit.
See 'docker run --help'."
Questions
Did I do anything wrong in installation process?
How can I run to pull rate limit when I have just installed it?
Have docker correctly installed on my laptop? (when I type docker --version in terminal I get "Docker version 20.10.2, build 2291f61"
What should I do now?
I just installed docker myself and encountered the same error.
I don't think you have installed it wrong (since I'm a newbie myself I cannot confirm it 100%), but I solved this error by creating an account in docker website and then logged-in from CLI.
to create an account go to: https://www.docker.com/pricing
and then use signup for free.
To login through CLI type:
docker login -u your-username
and then it asks for your password, and then you are good to go!

Problem installing Docker Ubuntu, step related to command "pub" (Ubuntu 18.04)

My ubuntu version:
No LSB modules are available./
Distributor ID: Ubuntu /
Description: Ubuntu 18.04.3 LTS /
Release: 18.04 /
Codename: bionic
To install Docker Engine - Community, you need the 64-bit version of one of these Ubuntu versions:
Disco 19.04
Cosmic 18.10
Bionic 18.04 (LTS) (Mine)
Xenial 16.04 (LTS)
Steps I followed:
Uninstall old versions
$ sudo apt-get remove docker docker-engine docker.io containerd runc
Update the apt package index:
$ sudo apt-get update #HasErrors (2)
(1) Err:14 https://dl.bintray.com/rabbitmq/debian $distribution Release
404 Not Found [IP: 3.124. ..........]
------------------------------------------------
(2) E: The repository 'https://dl.bintray.com/rabbitmq/debian $distribution Release' does not have a Release file.
In consequence: When I get to step 3 in the webpage: https://docs.docker.com/install/linux/docker-ce/ubuntu/
$ sudo apt-key fingerprint 0EBFCD88
pub rsa4096 2017-02-22 [SCEA]
9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid [ unknown] Docker Release (CE deb) <docker#docker.com>
sub rsa4096 2017-02-22 [S]
I get this error:
Command 'pub' not found, did you mean:
command 'hub' from snap hub (v2.13.0)
command 'dub' from snap dub (1.15.0)
command 'pcb' from deb pcb-gtk
command 'pcb' from deb pcb-lesstif
command 'pua' from deb pglistener
command 'pudb' from deb python-pudb
command 'puf' from deb puf
command 'pdb' from deb python
command 'dub' from deb dub
command 'publ' from deb atfs
See 'snap info <snapname>' for additional versions.
I just want to install Docker for Ubuntu and i am a little stuck here
Instead of installing from the repository, why don't you try doing it directly.
sudo apt-get update
sudo apt-get remove docker docker-engine docker.io
sudo apt install docker.io
sudo systemctl start docker
sudo systemctl enable docker
If this works, you will notice it only works with sudo the workaround for this issue is mentioned here
Let me know if this doesn't work! I'm also quite confused as to why your errors include RabbitMQ when you are trying to install docker on ubuntu?

docker Error with pre-create check: "We support Virtualbox starting with version 5

I'm trying to create docker machine host using the following command in fedora OS version 25.
docker-machine create -driver=virtualbox host01
I get below error while executing the command.
Error with pre-create check: "We support Virtualbox starting with version 5. Your VirtualBox install is \"WARNING:
The vboxdrv kernel module is not loaded.
Either there is no module available for the current kernel (4.10.12-200.fc25.x86_64) or it failed to load.
Please try load the kernel module by executing as root
dnf install akmod-VirtualBox kernel-devel-4.10.12-200.fc25.x86_64 akmods --kernels 4.10.12-200.fc25.x86_64 && systemctl restart systemd-modules-load.service
You will not be able to start VMs until this problem is fixed.\\n5.1.26r117224\".
Please upgrade at https://www.virtualbox.org"
I have already virtualbox latest version installed. Running the command suggested by
sudo dnf install akmod-VirtualBox kernel-devel-4.10.12-200.fc25.x86_64 akmods --kernels 4.10.12-200.fc25.x86_64 && systemctl restart systemd-modules-load.service
I got the below error
Last metadata expiration check: 0:48:35 ago on Thu Aug 17 22:38:47 2017.
Package akmods-0.5.6-7.fc25.noarch is already installed, skipping.
No package --kernels available.
No package 4.10.12-200.fc25.x86_64 available.
Any suggestions?
I also had this problem and for this I upgrade Virtual box to 5.2 using following commands. This link help me
sudo apt-get remove virtualbox virtualbox-5.1
sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian xenial contrib" >> /etc/apt/sources.list.d/virtualbox.list'
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get install virtualbox-5.2
Hope this helps.
For windows users, in 2022 such problem still exists. So for those who use last build (now it is virtualBox-6.1.32-149290-Win), try to use version that starts with prefix 5. But not all '5' versions work. For example, for me worked only version 5.2.42 while versions: 5.2.18, 5.2.20, 5.2.44 didn't work
Helped for win 11 x64

Dockerfile fails to build

Till few days back the Dockerfile was working fine and when i tried to build it again today it is giving following error in the terminal. I tried with multiple docker base images but still giving the same error. Can any one help me with this? I dont think i missed out anything. If i had missed it should have given me the error earlier itself but why now?
Err:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
Temporary failure resolving 'security.ubuntu.com'
Err:2 http://archive.ubuntu.com/ubuntu xenial InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease
Temporary failure resolving 'archive.ubuntu.com'
Reading package lists...
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease Temporary failure resolving 'security.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package software-properties-common
and my docker version is
Docker version 17.03.2-ce, build f5ec1e2
And here is my Dockerfile
FROM ubuntu:16.04
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && \
apt-get install -y software-properties-common && \
apt-add-repository ppa:webupd8team/java && \
apt-get update -y && \
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886 && \
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections && \
apt-get install -y oracle-java8-installer && \
apt-get install -y oracle-java8-unlimited-jce-policy && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/cache/oracle-jdk8-installer
ENV JAVA_HOME /usr/lib/jvm/java-8-oracle
If your host is an Ubuntu VM, it could be an invalid /etc/resolve.conf. Look at the /etc/resolv.conf on the host Ubuntu VM. If it contains nameserver 127.0.1.1, that is wrong.
Run these commands on the host Ubuntu VM to fix it:
sudo vi /etc/NetworkManager/NetworkManager.conf
# Comment out the line `dns=dnsmasq` with a `#`
# restart the network manager service
sudo systemctl restart network-manager
cat /etc/resolv.conf
Now /etc/resolv.conf should have a valid value for nameserver, which will be copied by the docker containers.
Looks like you have a connection error in your RUN instruction.
Try doing the same commands in an Ubuntu Container.
docker run -it ubuntu bash
And then inside the container do your RUN command.
On my machine, your script does work.
Solution that worked for me was to
check my host machine /etc/resolv.conf - looking for nameserver x.x.x.x
copy the nameserver that was there into my host machine's /etc/docker/daemon.json
this may require you to sudo su in order cd /etc/docker
you may not have that file, so just created it: nano daemon.json
add the following:
{
"dns": ["x.x.x.x", "z.z.z.z", "8.8.8.8"]
}
x.x.x.x and z.z.z.z could be your nameservers
8.8.8.8 is google's, which you can try.
Need to restart the docker daemon - sudo service docker restart
Over time my nameserver (at my house) changed, so I have a few, or I have to add to this file every now and then. It could also change if you are using the internet in different places - so this is not always the best solution.
I just changed my VM players network setting. Changed Network Connection from bridged mode to NAT.
Now its working
In my case bridge network was disabled in daemon.json.
After fixing as below it worked.
root#pc:/etc/docker# cat daemon.json
{
"iptables": true,
"bridge": "docker0"
}
And dont forget to restart:
sudo service docker restart
Also I used following useful commands to investigate the issue:
# List networks (it should have 3 lines bridge, host, none)
docker network ls
# Check the logs, it will have docker log
journalctl -xe
# This one showed me at the end that bridge was missing iptables config like below
# WARNING: bridge-nf-call-iptables is disabled
# WARNING: bridge-nf-call-ip6tables is disabled
docker info
A simple method could be write the nslookup archive.ubuntu.com IP to the /etc/hosts, then restart docker.
Of course it needs your docker 's /etc/docker/daemon.json use host machine 's IP.
Overview
There are two parts to your question:
1. fixing temporary resolve messages
2. fixing the package management issues
Temporary resolve
It is likely that this issue is either:
1. temporary due to your Internet Service Provider not correctly forwarding internet naming (DNS) to either its or external DNS servers, or
2. due to a change in your network has similarly blocked this naming - for example, new router/modem, reconfiguring a switch with a new configuration.
Let's look at the possible DNS resolving issues.
First, temporarily add a known DNS server to your system.
echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf > /dev/null
Then run sudo apt update.
If this fixes your temporary resolving messages then either wait for 24 hours to see if your ISP fixes the issue for you (or just contact your ISP) - or you can permanently add a DNS server to your system:
echo "nameserver 8.8.8.8" | sudo tee /etc/resolvconf/resolv.conf.d/base > /dev/null
8.8.8.8 is Google's own DNS server.
source
Another example DNS server you could use is OpenDNS- for example:
echo "nameserver 208.67.222.222" | sudo tee /etc/resolvconf/resolv.conf.d/base > /dev/null
package-management issues
In addition to the temporary resolve issues - you have a few package management issues that need to be corrected.
Open a terminal and type:-
sudo nano /etc/apt/sources.list
and look if you are downloading from right source package.
OR
if you are behind proxy use -E.for example:-
sudo -E apt-get update

Yum install / update not working inside docker images but working otherwise from the centos machine

I am able to yum install, or yum update from the server, but when trying to do same (as specified in the Dockerfile) inside a docker container, it fails stating the following common error :
One of the configured repositories failed (Unknown),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Run the command with the repository temporarily disabled
yum --disablerepo=<repoid> ...
4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:
yum-config-manager --disable <repoid>
or
subscription-manager repos --disable=<repoid>
5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
Cannot find a valid baseurl for repo: base/7/x86_64
my Docker file is a simple :
FROM centos:centos7
RUN echo "nameserver 8.8.8.8" > /etc/resolv.conf
RUN echo "nameserver 8.8.4.4" >> /etc/resolv.conf
RUN yum -y update; yum clean all
RUN yum -y install epel-release; yum clean all
RUN yum -y install python-pip; yum clean all
I have tried various things like adding ip_resolve=4 in /etc/yum.conf, or addinf 8.8.8.8 and 4.4.4.4 to /etc/resolv.conf and other methods, in vain.
here's the docker info :
Containers: 28
Running: 0
Paused: 0
Stopped: 28
Images: 144
Server Version: 1.13.0
docker-compose version 1.10.1, build b252738
docker-py version: 2.0.2
CPython version: 2.7.5
OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
Please help. I am only running things under a VPN, no proxy.
machine is an AMI : 3.10.0-514.el7.x86_64.
Need I add it's IP anywhere insde docker container? Please help.
TIA!

Resources