How to expand container size

The size limit of the Docker container has been reached and the container cannot be started.

PS C:\Users\lnest> docker system df
Images 1 1 8.476GB 0B (0%)
Containers 1 0 257.8GB 257.8GB (100%)
Local Volumes 0 0 0B 0B
Build Cache 0 0 0B 0B

Since only one container and one image exist, and there is no unnecessary data, there is no free space in the container.

I was able to resize the ext4.vhdx with the help of this page.

However, it seems that eventually I need to login to docker and run resize2fs.

Since there is no capacity left, I cannot download alpine or even boot it.
Is there anything that can be done about this situation?

No idea how to fix the problem if the wsl distribution is not even starting.

Note: one oddity that immediately hits the eye: while the image size is 8.476GB, the container created based on the image has 257.8GB and volumes have 0gb. Looks like all the persistent data was written into the container file system. The persistent data is practically jailed into the container and lives with its lifecycle. The proper way would have been to map a volume into the container folder(s) that store the persistent data.

1 Like