When I export a docker container, the intermediate size is massive compared to the container size. For example a 20GB container with a base disk size of 64GB using devicemapper can sometimes result in 400GB being streamed via the Docker API.
This is the final progress bar of curl: 100 429G 0 429G 0 0 116M 0 --:--:-- 1:03:11 --:--:-- 24.4M
Something similar happens even if I use the command line. At one point I ran out of space in the middle of an export becausedocker export <CONTAINER ID> -o <DESTINATION FILE>" created a 200GB file even though the container itself is 20GB. The intermediate file size varies from 100GB to 400GB. If it finishes, however, the final size is the same as the container size: 20GB.
Anyone know why this is happening? This happens both over command line and the Docker HTTP API.
Not all containers. Only containers that have been running for a while and grown in size from all the compiling they’re doing. The original base image size is only 2.6 GB but after fetching the code and compiling it, it grows to about 20GB. When I export those containers, that’s when I encounter this issue.