Docker on Mac: no space on device

I am trying to create a basic Docker image from Ubuntu 14.04 that installs Java 8. Here is what I still have:

FROM ubuntu:14.04 MAINTAINER Me Myself < memyself@example.com > WORKDIR / RUN \ echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \ apt-get install -y software-properties-common && \ add-apt-repository -y ppa:webupd8team/java && \ apt-get update && \ apt-get install -y oracle-java8-installer && \ rm -rf /var/lib/apt/lists/* && \ rm -rf /var/cache/oracle-jdk8-installer 

When I run docker build -t memyself/docker_sample . I get the following error when installing Java:

 myuser@mymachine :~/sandbox/workspace/docker_sample$docker build -t memyself/docker_sample . Sending build context to Docker daemon 127.1 MB Step 0 : FROM ubuntu:14.04 ---> 91e54dfb1179 Step 1 : MAINTAINER Me Myself < memyself@example.com > ---> Using cache ---> 070127f8f0e5 Step 2 : WORKDIR / ---> Using cache ---> d2c8a7633d41 Step 3 : RUN echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && add-apt-repository -y ppa:webupd8team/java && apt-get update && apt-get install -y oracle-java8-installer && rm -rf /var/lib/apt/lists/* && rm -rf /var/cache/oracle-jdk8-installer ---> Running in 548fc192e112 /bin/sh: 1: add-apt-repository: not found The command '/bin/sh -c echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && add-apt-repository -y ppa:webupd8team/java && apt-get update && apt-get install -y oracle-java8-installer && rm -rf /var/lib/apt/lists/* && rm -rf /var/cache/oracle-jdk8-installer' returned a non-zero code: 127 

Any idea that I would be wrong in?


Update:

I added the line apt-get install -y software-properties-common , and now I get a huge amount of results, some of which are:

 162816K ........ ........ ........ ........ ........ ........ 93% 3.92M 2s 165888K ........ ........ ........ ........ ........ ........ 95% 5.43M 1s 168960K ........ ........ ........ ........ ........ ........ 97% 6.35M 1s 172032K ........ ........ ........ ........ ........ ........ 98% 6.09M 0s 175104K ........ ........ ........ ..... 100% 5.27M=32s 2015-09-25 15:33:33 (5.43 MB/s) - 'jdk-8u60-linux-x64.tar.gz' saved [181238643/181238643] Download done. Removing outdated cached downloads... tar: jdk1.8.0_60/jre/lib/charsets.jar: Wrote only 3072 of 10240 bytes tar: jdk1.8.0_60/jre/lib/jce.jar: Cannot write: No space left on device tar: jdk1.8.0_60/jre/lib/amd64/libbci.so: Cannot write: No space left on device tar: jdk1.8.0_60/jre/lib/amd64/libjavafx_font_freetype.so: Cannot write: No space left on device tar: jdk1.8.0_60/jre/lib/amd64/libawt_headless.so: Cannot write: No space left on device tar: jdk1.8.0_60/jre/lib/amd64/libdt_socket.so: Cannot write: No space left on device tar: jdk1.8.0_60/jre/lib/amd64/libmlib_image.so: Cannot write: No space left on device ...Huge amount of output omitted for brevity... tar: jdk1.8.0_60/bin/jvisualvm: Cannot write: No space left on device tar: jdk1.8.0_60/bin/jcontrol: Cannot write: No space left on device tar: jdk1.8.0_60/release: Cannot write: No space left on device tar: Exiting with failure status due to previous errors cannot unpack jdk8 Oracle JDK 8 is NOT installed. debconf: DbDriver "config": could not write /var/cache/debconf/config.dat-new: No space left on device dpkg: error processing package oracle-java8-installer (--configure): subprocess installed post-installation script returned error exit status 1 Setting up gsfonts (1:8.11+urwcyr1.0.7~pre44-4.2ubuntu1) ... dpkg: unrecoverable fatal error, aborting: unable to flush /var/lib/dpkg/updates/tmp.i after padding: No space left on device E: Sub-process /usr/bin/dpkg returned an error code (2) 

Itโ€™s important to note that if I try to run more than a few other images (extracted from the Docker Hub) on my Mac, I get similar โ€œNo space on deviceโ€ errors. Therefore, I believe that this last problem may be due to the fact that it does not allocate enough space for Docker on my machine (similar to the JVM OutOfMemoryException problem).

+7
java-8 docker
source share
3 answers

Your file system in which dockers store their files is full. This is why tar suffocates when unpacking downloaded java archives.

docker info will show you where the files are located, for example

 Storage Driver: aufs Root Dir: /var/lib/docker/aufs 

df -h will tell you how much disk space is available on your file systems.

Use docker ps -a to find containers that can be removed and delete them with docker rm -v ( -v is important because it also deletes volumes). Use docker images to find unwanted images and delete them with docker rmi .

You may have tattered image layers that are no longer needed. Delete them using docker rmi $(docker images -q -f dangling=true) .

+17
source share

try adding

 apt-get install -y software-properties-common 

to get add-apt-repository . Either in another RUN command, or before using add-apt-repository .

+2
source share

Perhaps because Docker.qcow2 is full.

Check the size of the following file ls -lah ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2

There is an open problem for docker for mac related to this file, which is a rare image containing yo. See https://github.com/docker/for-mac/issues/371

I had the same problem, and since I did not mind restoring my containers, I just uninstalled Docker.qcow2, restarted docker and solved my problem. Use extreme caution, especially if you have many images that you rely on and cannot rebuild.

0
source share

All Articles