Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use docker system prune #420

Closed
wants to merge 1 commit into from
Closed

Use docker system prune #420

wants to merge 1 commit into from

Conversation

sau226
Copy link
Contributor

@sau226 sau226 commented Feb 13, 2019

This commit updates the repository to use Docker's built in method of
cleaning up old containers per Sam Saffron's request in #416.

The cleanup command and 1 instance where docker system prune was already used will call docker system prune -f (don't prompt the user for a yes/no to trigger the command) as the launcher script will prompt the user for confirmation before running docker system prune.

P.S: If you are working for Discourse and have write access to this repo feel free to add the -a (remove stopped containers as well as all unused images) option to where I've used docker system prune. I want your opinon on this so if you want/need it then feel free to commit that to my fork before merging (I'm fine with that).

This commit updates the repository to use Docker's built in method of
cleaning up old containers
@SamSaffron
Copy link
Member

Thanks heaps for the feedback here, I went ahead with the change (see last 2 commits) I strangely forgot to push my first attempt at it yesterday.

Let me know what you think.

@SamSaffron SamSaffron closed this Feb 13, 2019
@sau226
Copy link
Contributor Author

sau226 commented Feb 14, 2019

@SamSaffron I'd suggest using restoring the old code (in ./launcher only) and restoring the code from your first commit (but replace STATE_DIR=./.gc-state scripts/docker-gc with $docker_path system prune -a -f or similar).

Discourse also used to purge old logs by running rm -f shared/standalone/log/var-log/*.txt after the gc script would otherwise run. It doesn't appear to run any more now. This proposed restoration would allow the gate to be able to prune the containers and delete all the logs in 1 go.

If needed I can file a PR for this or an issue on meta. Let me know what you think.

@SamSaffron
Copy link
Member

not sure about this *.txt in var logs is a relic of the past, no need to worry about cleaning it up anymore.

if we can figure out extra stuff to remove on cleanup I am open to that ... but I fine the text we get back from prune -a to be fine for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants