user2417339
user2417339

Reputation:

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

I'm trying to build a Docker vm and continuously get this error:

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

I'm on Ubuntu 14 using Docker version 1.11.2, build b9f10c9. Here is the code for the Dockerimage:

FROM ubuntu:trusty
MAINTAINER Fernando Mayo <[email protected]>, Feng Honglin <[email protected]>
# 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"]

How can I fix this mounting problem?

Edit: Can running the host os on a live usb, specifically ubuntu, cause this problem?

Also I tried the suggestions from Error: "error creating aufs mount to" when building dockerfile but it didn't work.

Upvotes: 4

Views: 5912

Answers (2)

tsveti_iko
tsveti_iko

Reputation: 8032

aufs is a Docker storage driver. Docker storage drivers control how images and containers are stored on your filesystem. They’re the mechanism that lets you create images, start containers, and modify writable layers. aufs was the default storage driver before overlay2.

Now the issue may be that your Docker configuration may have different setup for the storage driver. The solution is to fix that configuration to use aufs like this:

  1. Stop Docker

    sudo systemctl stop docker
    
  2. Open the Docker deamon file

    sudo vi /etc/docker/daemon.json
    
  3. Add the following to the deamon file and save it

    {
        "storage-driver": "aufs"
    }
    
  4. Start Docker again

    sudo systemctl start docker
    

Reference: Official Docker Documentation (for configuring overlay2)

Upvotes: 0

BMitch
BMitch

Reputation: 264761

Live usb is almost certainly not ext4, or one of the other supported filesystems. Most likely it's doing overlay, and I don't think you can mount an overlayfs on top of an overlayfs.

You can lookup your current filesystem for /var/lib/docker with a mount command. E.g. in my local environment (I'm symlinked, hence the extra dot in my path and files showing in 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)

Note the "type ext4" in the mount output.

Docker has a list of supported backing filesystems:

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

Upvotes: 2

Related Questions