OSError: [Errno 28] No space left on device on docker-compose build step
makiftasova opened this issue · 2 comments
when I issued docker-compose build
after a few seconds I got the error below.
$ docker-compose build
Building init
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/docker/utils/build.py", line 180, in create_archive
t.addfile(i, f)
File "/usr/lib/python3.6/tarfile.py", line 1978, in addfile
copyfileobj(fileobj, self.fileobj, tarinfo.size, bufsize=bufsize)
File "/usr/lib/python3.6/tarfile.py", line 252, in copyfileobj
dst.write(buf)
File "/usr/lib/python3.6/tempfile.py", line 483, in func_wrapper
return func(*args, **kwargs)
OSError: [Errno 28] No space left on device
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/docker-compose", line 11, in <module>
load_entry_point('docker-compose==1.21.2', 'console_scripts', 'docker-compose')()
File "/usr/lib/python3.6/site-packages/compose/cli/main.py", line 71, in main
command()
File "/usr/lib/python3.6/site-packages/compose/cli/main.py", line 127, in perform_command
handler(command, command_options)
File "/usr/lib/python3.6/site-packages/compose/cli/main.py", line 282, in build
gzip=options.get('--compress', False),
File "/usr/lib/python3.6/site-packages/compose/project.py", line 373, in build
service.build(no_cache, pull, force_rm, memory, build_args, gzip)
File "/usr/lib/python3.6/site-packages/compose/service.py", line 1047, in build
platform=platform,
File "/usr/lib/python3.6/site-packages/docker/api/build.py", line 154, in build
path, exclude=exclude, dockerfile=dockerfile, gzip=gzip
File "/usr/lib/python3.6/site-packages/docker/utils/build.py", line 31, in tar
root=root, fileobj=fileobj, gzip=gzip, extra_files=extra_files
File "/usr/lib/python3.6/site-packages/docker/utils/build.py", line 183, in create_archive
'Can not read file in context: {}'.format(full_path)
OSError: Can not read file in context: /home/makiftasova/github/PwnAdventure3/pwn3.tar.gz
and
$ df -h
Filesystem Size Used Avail Use% Mounted on
dev 3.9G 0 3.9G 0% /dev
run 3.9G 1.2M 3.9G 1% /run
/dev/sda6 40G 26G 12G 70% /
tmpfs 3.9G 6.6M 3.9G 1% /dev/shm
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
tmpfs 3.9G 332K 3.9G 1% /tmp
/dev/sda3 2.0G 60M 1.8G 4% /boot
/dev/sda5 439G 150G 267G 36% /home
tmpfs 789M 20K 789M 1% /run/user/120
tmpfs 789M 16K 789M 1% /run/user/1000
After some digging, I find out docker-compose complains about the size of temp directory (which is mounted to /tmp
and RAM backed in my case) (see: https://stackoverflow.com/q/38619286 )
also # mount -o remount,size=7G,noatime /tmp
was enough to solve the issue in my case. (I beleive docker-compose tries to create a temporary archive around 5GB and my default tmpfs size is 4GB)
PS. onening this issue for future reference only, I've managed to run server on my old Asus k53sv with 8GB of RAM
OS: ArchLinux x86_64 (linux 4.17.2-1 & systemd 238.133-4)
Docker Version: 18.05.0-ce build f150324782
Mine is not solved yet
$ docker-compose build
master uses an image, skipping
game uses an image, skipping
Building init
Traceback (most recent call last):
File "site-packages/docker/utils/build.py", line 97, in create_archive
File "tarfile.py", line 1972, in addfile
File "tarfile.py", line 250, in copyfileobj
File "tempfile.py", line 481, in func_wrapper
OSError: [Errno 28] No space left on device
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "bin/docker-compose", line 6, in <module>
File "compose/cli/main.py", line 72, in main
File "compose/cli/main.py", line 128, in perform_command
File "compose/cli/main.py", line 303, in build
File "compose/project.py", line 403, in build
File "compose/project.py", line 385, in build_service
File "compose/service.py", line 1106, in build
File "site-packages/docker/api/build.py", line 160, in build
File "site-packages/docker/utils/build.py", line 31, in tar
File "site-packages/docker/utils/build.py", line 100, in create_archive
OSError: Can not read file in context: /home/pwn/PwnAdventure3/client/PwnAdventure3_Data/PwnAdventure3/PwnAdventure3/Binaries/Linux/PwnAdventure3Server
[1520] Failed to execute script docker-compose
$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 2.9G 0 2.9G 0% /dev
tmpfs 597M 1008K 596M 1% /run
/dev/sda2 9.8G 9.2G 139M 99% /
tmpfs 7.0G 0 7.0G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 7.0G 0 7.0G 0% /sys/fs/cgroup
shared 466G 452G 14G 98% /home/pwn/shared
/dev/loop0 90M 90M 0 100% /snap/core/8268
/dev/loop1 94M 94M 0 100% /snap/core/9066
tmpfs 597M 0 597M 0% /run/user/1000
Same here, with 8Gb of temporal size.