Running out of disk space in docker while building

While building swift compiler from source in Docker from a CentOS 7 base, the Swift build process always errors out with "no space left on device" even though I gave Docker a 120 GB allotment.

Here are the commands I run to build Swift:

RUN mkdir swift_source; cd swift_source \
&& git clone --depth 1 --branch swift-5.2.4-RELEASE https://github.com/apple/swift/ \
&& ./swift/utils/update-checkout --clone --tag swift-5.2.4-RELEASE \
&& cd /swift_source/swift \
&& utils/build-script --release-debuginfo --install-swiftpm true -j8

Why would this consume 120GB?

Does Swift really take 120 GB to build ...? Or is Docker malfunctioning?

The last thing in the Swift build log is:

[1011/1011][100%][1391.472s] Generating ../../../lib/swift/linux/libswiftRuntimeUnittest.so

Building the standard library for: swift-test-stdlib-linux-x86_64

Error processing tar file(exit status 1): write /swift_source/llvm-project/.git/objects/pack/pack-0dda29f330fc5d19735e97903df47249246f2bf7.pack: no space left on device

Before I started I verified only 4gb were in use (did a full prune).

After the failure, docker image ls outputs:

REPOSITORY                                                             TAG                 IMAGE ID            CREATED             SIZE
<none>                                                                 <none>              b9c08d2cc5ee        3 hours ago         701MB
<none>                                                                 <none>              e59f7a91d082        3 hours ago         822MB
docker-dev-artifactory.xxxxx.com/uic/bamboo-node-12                  latest              d3fea410682c        33 hours ago        821MB
docker-dev-artifactory.xxxxxx.com/centos7-zulu11jdk/master   latest              5dd2f2e4b6f1        3 days ago          584MB

And docker system df outputs:

TYPE                TOTAL               ACTIVE              SIZE                RECLAIMABLE
Images              4                   1                   1.523GB             1.406GB (92%)
Containers          1                   0                   61.34GB             61.34GB (100%)
Local Volumes       0                   0                   0B                  0B
Build Cache         0                   0                   0B                  0B

So I have no idea how it's consuming 120gb. Any ideas?

1 Like
Terms of Service

Privacy Policy

Cookie Policy