Skip to content

Docker build that fails with overlay storage backend only? #12327

Closed

Description

@lvangool

This Dockerfile doesn't seem to build with the overlay storage backend:

from ubuntu:trusty
RUN apt-get update && apt-get -y upgrade
RUN apt-get install -y build-essential g++ libblas-dev liblapack-dev gfortran python-dev python-pip
RUN pip install --upgrade numpy
RUN pip install --upgrade statsmodels
RUN pip install --upgrade flask

It ends up spitting out the below errors:

Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 283, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1443, in install
    requirement.commit_uninstall()
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 610, in commit_uninstall
    self.uninstalled.commit()
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1860, in commit
    rmtree(self.save_dir)
  File "/usr/lib/python2.7/dist-packages/pip/util.py", line 43, in rmtree
    onerror=rmtree_errorhandler)
  File "/usr/lib/python2.7/shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "/usr/lib/python2.7/shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "/usr/lib/python2.7/shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "/usr/lib/python2.7/shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "/usr/lib/python2.7/shutil.py", line 256, in rmtree
    onerror(os.rmdir, path, sys.exc_info())
  File "/usr/lib/python2.7/shutil.py", line 254, in rmtree
    os.rmdir(path)
OSError: [Errno 39] Directory not empty: '/tmp/pip-dXgb99-uninstall/usr/lib/python2.7/dist-packages'

The same Dockerfile works with both AUFS and DeviceMapper storage backends (have not tried with BTRFS).

docker version:

Client version: 1.5.0
Client API version: 1.17
Go version (client): go1.4.1
Git commit (client): a8a31ef
OS/Arch (client): linux/amd64
Server version: 1.5.0
Server API version: 1.17
Go version (server): go1.4.1
Git commit (server): a8a31ef

docker info:

Debug mode (server): false
Debug mode (client): true
Storage Driver: overlay
 Backing Filesystem: extfs
Execution Driver: native-0.2
Kernel Version: 3.18.0-031800-generic
Fds: 10
Goroutines: 15
EventsListeners: 0
Init Path: /usr/bin/docker
Docker Root Dir: /var/lib/docker
WARNING: No swap limit support

uname -a:

Linux my_server 3.18.0-031800-generic #201412071935 SMP Mon Dec 8 00:36:34 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Any suggestions or additional info I can provide?

Activity

  1. cpuguy83 commented on Apr 13, 2015

    @cpuguy83
    Member

    Can you try with either the master build or the latest 1.6 RC?
    https://master.docker.com for master binary
    #11635 (comment) for 1.6 RC

  2. lvangool commented on Apr 13, 2015

    @lvangool
    Author

    Tested, exact same problem I'm afraid.

    docker version:

    Client version: 1.6.0-rc5
    Client API version: 1.18
    Go version (client): go1.4.2
    Git commit (client): fc4825d
    OS/Arch (client): linux/amd64
    Server version: 1.6.0-rc5
    Server API version: 1.18
    Go version (server): go1.4.2
    Git commit (server): fc4825d
    OS/Arch (server): linux/amd64
    
  3. LK4D4 commented on Apr 13, 2015

    @LK4D4
    Contributor

    Yup, I can confirm in master.

  4. added
    kind/bug
    on Apr 13, 2015
  5. added this to the 1.7.0 milestone on Apr 13, 2015
  6. vbatts commented on Apr 14, 2015

    @vbatts
    Contributor

    @LK4D4 what kernel version are you running and underlying filesystem (ext4?)?

  7. lvangool commented on Apr 14, 2015

    @lvangool
    Author

    @vbatts yes, ext4 (kernel was 3.18 - tried with 3.19 too)

  8. LK4D4 commented on Apr 14, 2015

    @LK4D4
    Contributor

    @vbatts mine is 4.0 with ext4

  9. rochacon commented on Apr 29, 2015

    @rochacon

    Not sure if this is related with the overlay driver. Installing pip with the get-pip.py script, which installs the latest version, works fine on overlay.

    docker info

    % docker info
    Containers: 6
    Images: 45
    Storage Driver: overlay
     Backing Filesystem: extfs
    Execution Driver: native-0.2
    Kernel Version: 3.19.0
    Operating System: CoreOS 633.1.0
    CPUs: 1
    Total Memory: 996.4 MiB
    

    fail

    FROM ubuntu:14.04
    RUN apt-get update && apt-get install -yq python-pip && apt-get clean
    RUN pip install -U pip
    
    % docker build -t pip-on-docker-test .
    Sending build context to Docker daemon  12.8 kB
    Sending build context to Docker daemon
    Step 0 : FROM ubuntu:14.04
     ---> b7cf8f0d9e82
    Step 1 : RUN apt-get update && apt-get install -yq python-pip && apt-get clean
     ---> Running in 296e47de116e
    Ign http://archive.ubuntu.com trusty InRelease
    Ign http://archive.ubuntu.com trusty-updates InRelease
    Ign http://archive.ubuntu.com trusty-security InRelease
    Hit http://archive.ubuntu.com trusty Release.gpg
    
    ...Ommited apt-get output...
    
    Processing triggers for ca-certificates (20141019ubuntu0.14.04.1) ...
    Updating certificates in /etc/ssl/certs... 173 added, 0 removed; done.
    Running hooks in /etc/ca-certificates/update.d....done.
     ---> d10860df49b9
    Removing intermediate container 296e47de116e
    Step 2 : RUN pip install -U pip
     ---> Running in 888281f1cea1
    Downloading/unpacking pip from https://pypi.python.org/packages/py2.py3/p/pip/pip-6.1.1-py2.py3-none-any.whl#md5=172eb5abab25a5e0f7a7b63c7a49378d
    Installing collected packages: pip
      Found existing installation: pip 1.5.4
        Uninstalling pip:
          Successfully uninstalled pip
    Cleaning up...
    Exception:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
      File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 283, in run
      File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1443, in install
      File "/usr/lib/python2.7/dist-packages/pip/req.py", line 610, in commit_uninstall
      File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1860, in commit
      File "/usr/lib/python2.7/dist-packages/pip/util.py", line 43, in rmtree
      File "/usr/lib/python2.7/shutil.py", line 247, in rmtree
        rmtree(fullname, ignore_errors, onerror)
      File "/usr/lib/python2.7/shutil.py", line 247, in rmtree
        rmtree(fullname, ignore_errors, onerror)
      File "/usr/lib/python2.7/shutil.py", line 256, in rmtree
        onerror(os.rmdir, path, sys.exc_info())
      File "/usr/lib/python2.7/shutil.py", line 254, in rmtree
        os.rmdir(path)
    OSError: [Errno 39] Directory not empty: '/tmp/pip-ihvxTk-uninstall/usr/bin'
    
    Storing debug log for failure in /root/.pip/pip.log
    INFO[0079] The command [/bin/sh -c pip install -U pip] returned a non-zero code: 2
    

    success

    FROM ubuntu:14.04
    RUN apt-get update && apt-get install -yq curl python-dev && apt-get clean
    RUN curl https://bootstrap.pypa.io/get-pip.py | python
    RUN pip install -U pip
    
    % docker build -t pip-on-docker-test .
    Sending build context to Docker daemon 13.82 kB
    Sending build context to Docker daemon
    Step 0 : FROM ubuntu:14.04
     ---> b7cf8f0d9e82
    Step 1 : RUN apt-get update && apt-get install -yq curl python-dev && apt-get clean
     ---> Running in ef5a019b1a59
    Ign http://archive.ubuntu.com trusty InRelease
    Ign http://archive.ubuntu.com trusty-updates InRelease
    Ign http://archive.ubuntu.com trusty-security InRelease
    Hit http://archive.ubuntu.com trusty Release.gpg
    
    ...Ommited apt-get output...
    
    Processing triggers for ca-certificates (20141019ubuntu0.14.04.1) ...
    Updating certificates in /etc/ssl/certs... 173 added, 0 removed; done.
    Running hooks in /etc/ca-certificates/update.d....done.
     ---> b0da48adf546
    Removing intermediate container ef5a019b1a59
    Step 2 : RUN curl https://bootstrap.pypa.io/get-pip.py | python
     ---> Running in cce7df197a0b
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 1387k  100 1387k    0     0  4294k      0 --:--:-- --:--:-- --:--:-- 4282k
    /tmp/tmphICD6N/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
    Collecting pip
    /tmp/tmphICD6N/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
      Downloading pip-6.1.1-py2.py3-none-any.whl (1.1MB)
    Collecting setuptools
      Downloading setuptools-15.2-py2.py3-none-any.whl (501kB)
    Installing collected packages: pip, setuptools
    Successfully installed pip-6.1.1 setuptools-15.2
     ---> 7eb57b6961c5
    Removing intermediate container cce7df197a0b
    Step 3 : RUN pip install -U pip
     ---> Running in 5221ea38472c
    Requirement already up-to-date: pip in /usr/local/lib/python2.7/dist-packages
     ---> f3670b07fff6
    Removing intermediate container 5221ea38472c
    Successfully built f3670b07fff6
    
  10. vbatts commented on Apr 29, 2015

    @vbatts
    Contributor

    that would be nice to confirm. From my investigation, it seemed pretty murky in the failed example, that it made one of the egg info as a unix socket and failed to remove it from /tmp. Seemed like a bad file check somewhere, but I didn't feel like that was happening in the kernel...

  11. LK4D4 commented on Apr 29, 2015

    @LK4D4
    Contributor

    @vbatts unix-socket also mentioned in #12080

  12. vbatts commented on Apr 29, 2015

    @vbatts
    Contributor

    correct. Overlayfs and unix sockets do not play nice together yet. But why
    would a pip install make an egg info as a socket? those egg info are
    usually only regular file or directory.

    On Wed, Apr 29, 2015 at 1:24 PM, Alexander Morozov <[email protected]

    wrote:

    @vbatts https://github.com/vbatts unix-socket also mentioned in #12080
    #12080

    —
    Reply to this email directly or view it on GitHub
    #12327 (comment).

  13. removed this from the 1.7.0 milestone on May 28, 2015
  14. dustinlacewell commented on Aug 5, 2015

    @dustinlacewell

    Suffering from this exactly as above with Ubuntu 14.04 with 3.19.0-25-generic and Docker 1.7.1

  15. 38 remaining items

  16. strohel commented on Jul 27, 2016

    @strohel

    Hi all, I've recently upgraded Linux kernel to 4.6.4 (back from 4.1) and the problem seems to be gone! Do you have the same observation?

  17. added a commit that references this issue on Jul 28, 2016
  18. justincormack commented on Sep 19, 2016

    @justincormack
    Contributor

    Seems to be fixed in 4.4.21 too. (4.4 stable series has had a lot of the overlay fixes backported recently).

  19. mkocikowski commented on Oct 3, 2016

    @mkocikowski

    This problem doesn't seem to be specific to python / pip. Running overlay fs on ext4, kernel 4.4 (info below) a simple COPY foo /foo will fail with "no such file or directory" error (error in the last line of the shell output below):

    root@host:~# uname -a
    Linux host 4.4.0-38-generic #57-Ubuntu SMP Tue Sep 6 15:42:33 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
    root@host:~# docker info
    Containers: 25
     Running: 5
     Paused: 0
     Stopped: 20
    Images: 28
    Server Version: 1.12.1
    Storage Driver: overlay
     Backing Filesystem: extfs
    Logging Driver: journald
    Cgroup Driver: cgroupfs
    Plugins:
     Volume: local
     Network: null host bridge overlay
    Swarm: inactive
    Runtimes: runc
    Default Runtime: runc
    Security Options: apparmor seccomp
    Kernel Version: 4.4.0-38-generic
    Operating System: Ubuntu 16.04.1 LTS
    OSType: linux
    Architecture: x86_64
    CPUs: 2
    Total Memory: 7.795 GiB
    Name: host
    ID: SMFL:O7UP:7O4O:RVSD:QIQ2:FMX5:EVF5:UY74:336S:3QWI:DSEU:2HME
    Docker Root Dir: /var/lib/docker
    Debug Mode (client): false
    Debug Mode (server): false
    Registry: https://index.docker.io/v1/
    WARNING: No swap limit support
    Insecure Registries:
     127.0.0.0/8
    root@host:~# ls
    Dockerfile  foo
    root@host:~# cat Dockerfile
    FROM alpine
    COPY foo /foo
    root@host:~# docker build .
    Sending build context to Docker daemon  21.5 kB
    Step 1 : FROM alpine
     ---> ee4603260daa
    Step 2 : COPY foo /foo
    stat /var/lib/docker/overlay/78c71862cccbd03b4a5be0f44e21753c7fee96ecc37f6e8048497d6f14141ee1/merged/foo: no such file or directory
    root@host:~#

    Strangely enough, restarting docker engine "solved" the problem.

  20. thaJeztah commented on Oct 10, 2016

    @thaJeztah
    Member

    This issue is resolved in recent kernels

    This issue is resolved in recent kernels; if possible, upgrade your kernel to a version that includes this fix, or contact your OS vendor to make sure they carry the fix that resolves this. For more information, read the comments above; #12327 (comment), and #12327 (comment).

    Note that this is not a bug in Docker, so please don't comment that you're still having this on docker version x.y.z.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/kernelarea/storage/overlaykind/bugversion/1.5

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions