linux - Docker:创建aufs挂载到/var/lib/docker/aufs/mnt/15396ee0f38d161382f104e11c94b6ca0efafe10f9952e1dfba4f548009fbe59-init时出错:参数无效

标签 linux ubuntu docker kernel mount

我正在尝试构建一个 Docker 虚拟机并不断收到此错误:

error creating aufs mount to /var/lib/docker/aufs/mnt/15396ee0f38d161382f104e11c94b6ca0efafe10f9952e1dfba4f548009fbe59-init: invalid argument

我在 Ubuntu 14 上使用 Docker 版本 1.11.2,构建 b9f10c9。 这是 Dockerimage 的代码:

FROM ubuntu:trusty
MAINTAINER Fernando Mayo <fernando@tutum.co>, Feng Honglin <hfeng@tutum.co>
# Install packages
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
  apt-get -y install vim supervisor git curl unzip apache2 libapache2-mod-php5 pwgen php-apc php5-mcrypt php5-mysql php5-curl&& \
  echo "ServerName localhost" >> /etc/apache2/apache2.conf


# Install Composer
RUN curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
RUN composer global require "laravel/installer"
ENV PATH ~/.composer/vendor/bin:$PATH

# Add image configuration and scripts
ADD start-apache2.sh /start-apache2.sh
ADD start-mysqld.sh /start-mysqld.sh
ADD run.sh /run.sh
RUN chmod 755 /*.sh
ADD my.cnf /etc/mysql/conf.d/my.cnf
ADD supervisord-apache2.conf /etc/supervisor/conf.d/supervisord-apache2.conf
ADD supervisord-mysqld.conf /etc/supervisor/conf.d/supervisord-mysqld.conf
ADD php.ini /etc/php5/cli/php.ini
ADD 000-default.conf /etc/apache2/sites-available/000-default.conf


# config to enable .htaccess
RUN a2enmod rewrite


# Copy over private key, and set permissions
ADD .ssh /root/.ssh


# Get aws stuff
RUN curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
RUN unzip awscli-bundle.zip
RUN ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws


#####This section has been moved into the run.sh to allow for cached builds that get the most up to date git repository. This is done by using ENTRYPOINT rather than RUN
# Clone the repo
RUN rm -rd /var/www/html
#RUN git clone ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/Server /var/www/html
# Set file permissions
#RUN chmod -R 777 /var/www/html/storage 
#RUN chmod -R 777 /var/www/html/bootstrap/cache
ENTRYPOINT /run.sh
###########################################################################################





# Environment variables to configure php
ENV PHP_UPLOAD_MAX_FILESIZE 10M
ENV PHP_POST_MAX_SIZE 10M




EXPOSE 80 3306
CMD ["/run.sh"]

我该如何解决这个安装问题?

编辑:在 live usb 上运行主机操作系统,特别是 ubuntu,会导致这个问题吗?

我也尝试了 Error: "error creating aufs mount to" when building dockerfile 的建议 但它没有用。

最佳答案

Live usb 几乎可以肯定不是 ext4,也不是其他受支持的文件系统之一。它很可能正在覆盖,我认为您不能在 overlayfs 之上安装 overlayfs。

您可以使用 mount 命令查找当前文件系统的/var/lib/docker。例如。在我的本地环境中(我是符号链接(symbolic link)的,因此我的路径和文件中的额外点显示在 homelv 中):

# df /var/lib/docker/.
Filesystem                               1K-blocks      Used Available Use% Mounted on
/dev/mapper/bmitch--vg-homelv 720798904 437701948 246459468  64% /home

# mount | grep /dev/mapper/bmitch
/dev/mapper/bmitch--vg-homelv on /home type ext4 (rw,relatime,data=ordered)

注意挂载输出中的“type ext4”。

Docker 有一个列表 supported backing filesystems :

  • overlay2, overlay: xfs with ftype=1, ext4
  • aufs: xfs, ext4
  • devicemapper: direct-lvm
  • btrfs: btrfs
  • zfs: zfs
  • vfs: any filesystem

关于linux - Docker:创建aufs挂载到/var/lib/docker/aufs/mnt/15396ee0f38d161382f104e11c94b6ca0efafe10f9952e1dfba4f548009fbe59-init时出错:参数无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38062694/

相关文章:

linux - 非阻塞 tcp 与 epoll 连接

Linux Fultter 桌面 - 无法从已编译的可执行文件运行应用程序,flutter run 有效

ubuntu - 未找到时间戳 proto 和其他 proto 文件,即使它们存在于/usr/local/bin/include/google/protobuf

mysql - 无法连接到我的 mac 上运行的 mysql

docker - NGINX作为另一个容器上的反向代理-如何配置配置文件

docker - k3d 拉取镜像失败 "docker.io/rancher/pause:3.1"

c++ - 在 while 循环中执行操作,直到调用组合键 C++

linux - 线程.h :10:24: fatal error installation error

linux - 内核崩溃 - 创建自己的 AMI(Amazon 机器镜像)

c - "~[]"有什么作用?