Dokku/Docker out of disk space - How to enter app
Asked Answered
E

1

6

So my question is I have an errant rails app deployed using Dokku with the default Digital Ocean setup. This rails app has eaten all of the disk space as I did not set up anything to clean out the /tmp directory.

So the output of df is:

Filesystem 1K-blocks Used Available Use% Mounted on udev 1506176 0 1506176 0% /dev tmpfs 307356 27488 279868 9% /run /dev/vda1 60795672 60779288 0 100% / tmpfs 1536772 0 1536772 0% /dev/shm tmpfs 5120 0 5120 0% /run/lock tmpfs 1536772 0 1536772 0% /sys/fs/cgroup /dev/vda15 106858 3419 103439 4% /boot/efi tmpfs 307352 0 307352 0% /run/user/0

So I am out of disk space, but I don't know how to enter the container to clean it. Any dokku **** return /home/dokku/.basher/bash: main: command not found Access denied which I have found out is because I am completely out of HD space.

So 2 questions.

1: How do I get into the container to clear the tmp directory

2: Is there a way to set a max disk size limit so Dokku doesn't eat the entire HD again?

Thanks

Excite answered 27/11, 2018 at 21:10 Comment(1)
I'm also facing this problemSpringtime
P
6

Dokku uses docker to deploy your application, you are probably accumulating a bunch of stale docker images, which over time can take over all of your disk space.

Try running this:

docker image ls

Then try removing unused images:

docker system prune -a

For more details, see: https://www.digitalocean.com/community/tutorials/how-to-remove-docker-images-containers-and-volumes

Picador answered 13/1, 2021 at 17:54 Comment(2)
I've continued to prune images but the space has continued to be consumed, now there's nothing left to prune and I'm out of space. I wonder if this is due to storage and logs being kept?Existentialism
@Existentialism you're likely retaining deployment volumes, dokku doesn't clear that stuff by itself for some obscure reason. If you continuously deploy on that dokku instance set a crontab to run docker volumes prune daily at midnight or somethingCoset

© 2022 - 2024 — McMap. All rights reserved.