问题1: 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
docker pull 时报错,提示受限: 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
Trying to pull repository docker.io/library/eclipse-mosquitto ...
toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
Status: Downloaded newer image for docker.io/eclipse-mosquitto:latest
[root@localhost ~]#
复制代码
问题2: 启动docker服务失败: container-storage-setup: ERROR: Can not setup storage driver overlay2 as system does not support it. Specify a different driver.
[root@localhost ~]# service docker start
Redirecting to /bin/systemctl start docker.service
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
[root@localhost ~]#
[root@localhost ~]# service docker status
Redirecting to /bin/systemctl status docker.service
Apr 01 16:09:29 localhost.localdomain dockerd-current[2300]: unable to configure the Docker daemon with file /etc/docker/daemon.json: invalid character '}' look...y string
Apr 01 16:09:29 localhost.localdomain systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Apr 1 16:09:29 localhost container-storage-setup: ERROR: Failed to run unshare -m mount -t overlay -o lowerdir=/run/container-storage-setup//lower1:/run/container-storage-setup//lower2,upperdir=/run/container-storage-setup//upper,workdir=/run/container-storage-setup//work none /run/container-storage-setup//merged
Apr 1 16:09:29 localhost container-storage-setup: ERROR: Can not setup storage driver overlay2 as system does not support it. Specify a different driver.
Apr 1 16:09:29 localhost systemd: docker-storage-setup.service: main process exited, code=exited, status=1/FAILURE
Apr 1 16:09:29 localhost dockerd-current: unable to configure the Docker daemon with file /etc/docker/daemon.json: invalid character '}' looking for beginning of object key string
Apr 1 16:09:29 localhost systemd: docker.service: main process exited, code=exited, status=1/FAILURE
Ideally, very little data is written to a container’s writable layer, and you use Docker volumes to write data. However, some workloads require you to be able to write to the container’s writable layer. This is where storage drivers come in.
Docker supports several storage drivers, using a pluggable architecture. The storage driver controls how images and containers are stored and managed on your Docker host. After you have read the storage driver overview, the next step is to choose the best storage driver for your workloads. Use the storage driver with the best overall performance and stability in the most usual scenarios.
The Docker Engine provides the following storage drivers on Linux:
Driver: Description
overlay2: overlay2 is the preferred storage driver for all currently supported Linux distributions, and requires no extra configuration.
fuse-overlayfs: fuse-overlayfsis preferred only for running Rootless Docker on a host that does not provide support for rootless overlay2. On Ubuntu and Debian 10, the fuse-overlayfs driver does not need to be used, and overlay2 works even in rootless mode. Refer to the rootless mode documentation for details.
btrfs and zfs: The btrfs and zfs storage drivers allow for advanced options, such as creating “snapshots”, but require more maintenance and setup. Each of these relies on the backing filesystem being configured correctly.
vfs: The vfs storage driver is intended for testing purposes, and for situations where no copy-on-write filesystem can be used. Performance of this storage driver is poor, and is not generally recommended for production use.
aufs: The aufs storage driver Was the preferred storage driver for Docker 18.06 and older, when running on Ubuntu 14.04 on kernel 3.13 which had no support for overlay2. However, current versions of Ubuntu and Debian now have support for overlay2, which is now the recommended driver.
devicemapper: The devicemapper storage driver requires direct-lvm for production environments, because loopback-lvm, while zero-configuration, has very poor performance. devicemapper was the recommended storage driver for CentOS and RHEL, as their kernel version did not support overlay2. However, current versions of CentOS and RHEL now have support for overlay2, which is now the recommended driver.
overlay: The legacy overlay driver was used for kernels that did not support the “multiple-lowerdir” feature required for overlay2 All currently supported Linux distributions now provide support for this, and it is therefore deprecated.
The Docker Engine has a prioritized list of which storage driver to use if no storage driver is explicitly configured, assuming that the storage driver meets the prerequisites, and automatically selects a compatible storage driver. You can see the order in the source code for Docker Engine 20.10.
Some storage drivers require you to use a specific format for the backing filesystem. If you have external requirements to use a specific backing filesystem, this may limit your choices. See Supported backing filesystems.
另外找到docker支持文件系统类型:
Supported backing filesystems:
With regard to Docker, the backing filesystem is the filesystem where /var/lib/docker/ is located. Some storage drivers only work with specific backing filesystems.
Storage driver: Supported backing filesystems
overlay2, overlay: xfs with ftype=1, ext4
fuse-overlayfs: any filesystem
aufs: xfs, ext4
devicemapper: direct-lvm
btrfs: btrfs
zfs: zfs
vfs: any filesystem
问题原因:
ERROR: Can not setup storage driver overlay2 as system does not support it. Specify a different driver.
devicemapper was the recommended storage driver for CentOS and RHEL, as their kernel version did not support overlay2. However, current versions of CentOS and RHEL now have support for overlay2, which is now the recommended driver.
RHEL或CentOS 使用新的 docker 存储驱动(overlay or overlay2),需要升级系统内核版本到3.10.0-514以上版本,否则不支持 overlay or overlay2 存储驱动。
我的docker配置的默认的存储驱动为 overlay2:
cat /etc/sysconfig/docker-storage-setup
STORAGE_DRIVER=overlay2
cat /etc/sysconfig/docker-storage
DOCKER_STORAGE_OPTIONS=
我的Centos7内核版本为:3.10.0-229,版本太低
[root@localhost ~]# uname -a
Linux localhost.localdomain 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux