Skip to content

Instantly share code, notes, and snippets.

@TiloGit
Created June 4, 2025 17:44
Show Gist options
  • Save TiloGit/74f798986f7c1b69cd78d2b477c1bc17 to your computer and use it in GitHub Desktop.
Save TiloGit/74f798986f7c1b69cd78d2b477c1bc17 to your computer and use it in GitHub Desktop.
Test tmp file size for container (docker or kubernetes)
### test on k8s
#kubectl run tilotmptest --image=registry.access.redhat.com/ubi8/openjdk-8-runtime --wait --restart=Never --command dd if=/dev/zero of=/tmp/testfile bs=500k count=1024
#kubectl logs tilotmptest && kubectl delete pod tilotmptest
# 1 GB
kubectl run tilotmptest --image=registry.access.redhat.com/ubi8/openjdk-8-runtime --attach --rm --restart=Never --command dd if=/dev/zero of=/tmp/testfile bs=1000k count=1024
# 5 GB
kubectl run tilotmptest --image=registry.access.redhat.com/ubi8/openjdk-8-runtime --attach --rm --restart=Never --command dd if=/dev/zero of=/tmp/testfile bs=5000k count=1024
##test on docker
#100MB
docker run registry.access.redhat.com/ubi8/openjdk-8-runtime dd if=/dev/zero of=/tmp/testfile bs=100k count=1024
#5 GB
docker run registry.access.redhat.com/ubi8/openjdk-8-runtime dd if=/dev/zero of=/tmp/testfile bs=5000k count=1024
@TiloGit
Copy link
Author

TiloGit commented Jun 4, 2025

based on this: moby/moby#12940 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment