Bug 1093000

Summary: Unable to save an image to a tar archive
Product: [Fedora] Fedora Reporter: Lukas Slebodnik <lslebodn>
Component: docker-ioAssignee: Daniel Walsh <dwalsh>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: admiller, alexl, dwalsh, golang-updates, lsm5, mattdm, mgoldman, s, vbatts
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-05-29 11:56:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Lukas Slebodnik 2014-04-30 11:55:52 UTC
Description of problem:
I tried to dump content of docker image to a tarball with command "docker save"
It failed with error message "no space left on device"

Version-Release number of selected component (if applicable):
I was able to reproduce problem with docker-io from stable repository and with docker-io from updates-testing

[root@vm-169 docker]# rpm -q docker-io
docker-io-0.9.1-1.fc20.x86_64
or
docker-io-0.10.0-2.fc20.x86_64

How reproducible:
Allways


Steps to Reproduce:
1. Create big docker image (e.g. 1.8 GiB)
[root@vm-169 docker-freeipa]# docker images 
REPOSITORY    TAG       IMAGE ID            CREATED             VIRTUAL SIZE
big_image     latest    b366efe500de        57 minutes ago      1.778 GB
fedora        20        b7de3133ff98        5 days ago          372.7 MB

2. save docker image to tarball
[root@vm-169 docker]# docker save big_image > big_image.tar


Actual results:
[root@vm-169 docker]# docker save big_image > big_image.tar
2014/04/30 12:39:38 Error: write /docker-export-085323451/934d868afd0a79629df2cad704cbc1ed9344654625569263a630933d2785de57/layer.tar: no space left on device
[root@vm-169 docker]# file big_image.tar
big_image.tar: empty
[root@vm-169 docker]# ls -l big_image.tar 
-rw-r--r--. 1 root root 0 Apr 30 13:41 big_image.tar

Expected results:
File big_image.tar should not be empty and should contain data from docker image with name big_image


Additional info:
Directory /tmp should be used for creating small temporary files, because it is mounted on tmpfs. I think it would be better to use /var/tmp in this case.

Comment 1 Sam Kottler 2014-04-30 12:08:54 UTC
This really isn't a bug, I'd suggest you take it up with the upstream docker maintainers. IMHO, /tmp (or, as you point out /var/tmp) is the best place for the temporary images and if you need to create very large images then you need to have enough space in the temporary directory.

But your machine running out of space because of a large image isn't a bug.

Comment 2 Lukas Slebodnik 2014-04-30 12:47:34 UTC
I don't have problem with creating large images. The docker image has already been created. I have problem with exporting docker image to tarball.

It is not problem that my machine is running out of space. I have a lot of free space on my disk and I didn't want to store anything on /tmp

[root@vm-169 ~]# df -h /root/
Filesystem                   Size  Used Avail Use% Mounted on
/dev/mapper/vg_root-lv_root  9.5G  4.4G  4.6G  50% /
[root@vm-169 ~]# docker save big_image > /root/big_image.tar
2014/04/30 14:33:02 Error: write /tmp/docker-export-638760671/934d868afd0a79629df2cad704cbc1ed9344654625569263a630933d2785de57/layer.tar: no space left on device

According to docker help, the image should be streamed to standard output. I would expect it works without any side effect. And if docker cannot limit size of temporary files it will be better to use /var/tmp.

/tmp is by default mounted as tmpfs. It was introduced in fedora 18
https://fedoraproject.org/wiki/Features/tmp-on-tmpfs
Yes, it can be overridden by administrator, so there is a workaround.
But in my opinion, it should work with default settings.
And changing temporary directory from /tmp to /var/tmp should be easy.

Comment 3 Daniel Walsh 2014-05-28 16:43:40 UTC
Alex do you have an idea on this?

Comment 4 Alexander Larsson 2014-06-12 15:31:17 UTC
I don't see why we would have to temporarily store it to disk at all.

Comment 5 Daniel Walsh 2014-06-16 20:22:55 UTC
https://github.com/dotcloud/docker/pull/6456

Should fix this issue.

Lokesh can you add this patch.

Comment 6 Daniel Walsh 2014-06-17 18:34:06 UTC
Lokesh could you add this pull request to docker-1.0 in rawhide so we can get some testing on it.

Comment 7 Daniel Walsh 2014-09-15 19:57:57 UTC
Fixed in docker-1.1.2

Comment 8 Fedora End Of Life 2015-05-29 11:43:00 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 9 Lukas Slebodnik 2015-05-29 11:56:52 UTC
It's already fixed in fedora 21

bash-4.3# grep tmp /etc/sysconfig/docker
# docker load and build operations. Default is /var/lib/docker/tmp
# DOCKER_TMPDIR=/var/tmp