Skip to content

DockerClientFactory is wrong at guessing available disk space #223

Closed

Description

@mbaechler

Here is what I get when starting a container :

[main] INFO org.testcontainers.DockerClientFactory - Connected to docker: 
  Server Version: 1.12.1-rc2
  API Version: 1.24
  Operating System: Debian GNU/Linux stretch/sid
  Total Memory: 7783 MB
[main] INFO org.testcontainers.DockerClientFactory - Disk utilization in Docker environment is 0% (0 MB available)
[main] ERROR org.testcontainers.DockerClientFactory - Docker environment has less than 2GB free - execution is unlikely to succeed so will be aborted.

The problem is here IMO : CreateContainerResponse createContainerResponse = client.createContainerCmd("alpine:3.2").withCmd("df", "-P").exec();

The result of such a command is :

$ docker run --rm -ti alpine:3.2 df -P
Filesystem           1024-blocks    Used Available Capacity Mounted on
$

It's certainly what is expected.

Activity

  1. rnorth commented on Sep 14, 2016

    @rnorth
    Member

    Matthieu,

    Thanks - that's very odd. I've seen the results of df vary in interesting
    ways (seemingly based on host OS and/or volume driver) but never 'empty'
    output like that.

    I'll look to fix, but will also have a bit of a rethink bout the utility of
    performing disk space checks - it was useful in the early days of the
    library when image removal was troublesome, but perhaps now it's not
    serving a useful purpose...

    Richard
    On Tue, 13 Sep 2016 at 16:22, Matthieu Baechler notifications@github.com
    wrote:

    Here is what I get when starting a container :

    [main] INFO org.testcontainers.DockerClientFactory - Connected to docker:
    Server Version: 1.12.1-rc2
    API Version: 1.24
    Operating System: Debian GNU/Linux stretch/sid
    Total Memory: 7783 MB
    [main] INFO org.testcontainers.DockerClientFactory - Disk utilization in Docker environment is 0% (0 MB available)
    [main] ERROR org.testcontainers.DockerClientFactory - Docker environment has less than 2GB free - execution is unlikely to succeed so will be aborted.

    The problem is here IMO : CreateContainerResponse createContainerResponse
    = client.createContainerCmd("alpine:3.2").withCmd("df", "-P").exec();

    The result of such a command is :

    $ docker run --rm -ti alpine:3.2 df -P
    Filesystem 1024-blocks Used Available Capacity Mounted on
    $

    It's certainly what is expected.

    —
    You are receiving this because you are subscribed to this thread.
    Reply to this email directly, view it on GitHub
    #223, or mute
    the thread
    https://github.com/notifications/unsubscribe-auth/AAIET7r1GS2D6QTenxmMUPqhtnoo1TQOks5qpr-dgaJpZM4J7zRr
    .

    Richard

  2. mbaechler commented on Sep 15, 2016

    @mbaechler
    ContributorAuthor

    I tried running the same command with a debian-based image and the output is non-empty.
    We could at least prevent failure if we are not able to parse df output, It could be enough for now ?

  3. mrVanDalo commented on Sep 16, 2016

    @mrVanDalo

    Have the same problem here :(

  4. mbaechler commented on Sep 20, 2016

    @mbaechler
    ContributorAuthor
  5. rnorth commented on Nov 20, 2016

    @rnorth
    Member

    I'll close this as the fix was merged previously.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions