Discourse 清理存储空间的方法

Discourse 使用一段时间以后会发现硬盘空间占用非常多。

主要是因为 Docker Image 的问题,如果升级次数越多,空间占用越多。

运行下面的命令:

./launcher cleanup

能够帮助你清理 Discourse 占用的空间。

如下面代码所示:

[[email protected] discourse]# ./launcher cleanup
WARNING! This will remove all stopped containers.
Are you sure you want to continue? [y/N] y
Deleted Containers:
56cf2b82033af7813aaf7ee02eb8793aa15f8d3a025df8af2e4df75cc8f4dc96

Total reclaimed space: 0B
WARNING! This will remove all images without at least one container associated to them.
Are you sure you want to continue? [y/N] y
Deleted Images:
deleted: sha256:506f9cdf603a473f3ba35a8ba01ca70024849dd5c3797da49e0d3c7c802a4f0b
deleted: sha256:f1d2b9d8a3e0db1e7bb0a67743a614c4d1b3a7e067c53a4434fd72ed7d67df52
untagged: discourse/base:2.0.20210415-1332
untagged: discourse/[email protected]:b3b1eb6d859d683f26ad2a02e0efabcd502a63ab07b8211e4c425aa7ba7dd3a4
deleted: sha256:30e4746e631e7577e7ebd083e48947c755842801a00bc257e47759fecd499712
deleted: sha256:c1895ca2a8f6e6463a576d86b0038b82e86919c8899ebad7e15021d45e7f7199
deleted: sha256:7e718b9c0c8c2e6420fe9c4d1d551088e314fe923dce4b2caf75891d82fb227d
deleted: sha256:50db4216c5d5c853293af9fab8d467c74b1e71d82e70a03c8dd1984dc3ef0431
deleted: sha256:b62f20d4a8836c1d9abcf081c16c834587ec15680a8bd34017a0621510aea57b
untagged: discourse/base:2.0.20201221-2020
untagged: discourse/[email protected]:e181dd9046cc293b10c5b29bbc21c5aa8b939ba5f0c500da4a9e952ed0b5195d
deleted: sha256:6b45f8ee2ab2e90b0a8ea371d51f5f0dc080b7955f9812b47a79c261aaa29823
deleted: sha256:05c8e0789bfe3e0486776c00befc48d0f0e5569c0361f181877f9611c6f1f635
deleted: sha256:3311925cea5165456fa79172f8186c58d80c2424bcd2c899a899a66ba51de9b4
deleted: sha256:a0676b0d76ab4dbef950969be61a733e5d8282b2ad2685105aa179f0707a74d8
deleted: sha256:8ecb2a5f79248ebea87567efabd251562fee6d09858fdd391a116eb42d641feb
deleted: sha256:51f0314e2e6ae5c1ca3e4075bdd919980135340f24a40f1a574cdd5eadc57b09
deleted: sha256:aab4715f96bfbcb2f97387ef16730db52252ac3a01a1d37c2f9f2da031316b97
deleted: sha256:c98b940b38e61975ea39e2e8159796b6d21baf4bb7f5d0418edce2aca657bff5
untagged: hello-world:latest
untagged: [email protected]:1a523af650137b8accdaed439c17d684df61ee4d74feac151b5b337bd29e7eec
deleted: sha256:bf756fb1ae65adf866bd8c456593cd24beb6a0a061dedf42b26a993176745f6b
deleted: sha256:9c27e219663c25e0f28493790cc0b88bc973ba3b1686355f221c38a36978ac63
untagged: discourse/base:2.0.20220720-0049
untagged: discourse/[email protected]:7ff397003c78b64c9131726756014710e2e67568fbc88daad846d2b368a02364
deleted: sha256:7be781c858e622c5fb31b9dc6a5d3e492c065b904ffc16ce477fcc53ca65b9fa
deleted: sha256:5b5900cb8266bbdd3e06b78abc67a0dcec04af1381ff630faa56b5c0149692c9
deleted: sha256:09dd498b1f776d6661e4b47b24e70d3bbc7db406345d65ced288f6b245927a9c
deleted: sha256:5ac0c84a3441c11fb2c39479fef77749eee9f96ba12bc9da9c049c14788775a3
deleted: sha256:c8c660d577fda3361260d76be6e0fabf3da4588e3d999cc99753203af01f6e80
deleted: sha256:3e45b3847b22d5a008e7a4e01a1c7bd39d75225589e18c2ab545ba809a613601
untagged: discourse/base:2.0.20211118-0105
untagged: discourse/[email protected]:74b41fffd4f05433eb7c9b72954b1f5f8b15cd0e802bb724c96b7d699c3f6fa1
deleted: sha256:b6cc7cf8974a6ef7bb64c36f4592af261cda0d5565bd91da603568ce26968048
deleted: sha256:c1455b2fdbca024c36c4e75746051b77c3637020cfa1e36a41440292a8c39424
deleted: sha256:77b323d4ec74aad770337f99a60e862a64ccc53f4775b5f4945df0e606f78b90
untagged: discourse/base:2.0.20210528-1735
untagged: discourse/[email protected]:b1890ab83b905ada5c9b7221264d62159bbf63bda706cdc652b0533bc90431c5
deleted: sha256:4ce0d1e5d32feaa17da3d402ab2f5fe038137662ce77d165e0567d76db40c095
deleted: sha256:5c06ea48f14b9a051dbcccf1a0412e85df72ab9e21af9c1962e3cdea0b1b2a77
deleted: sha256:a0514302287107820c8e83f8f895c7f6a7ba563a577ebac462574b0d9b43c5ee
deleted: sha256:e3a31c05b5e75d8d70d5de0b54eaabeee2038934666c03a0345ad41a2cd9bb55
deleted: sha256:482386bf57afd5847d36e8ee4324f76d63e7cdf5234e7be3b760b78f64db7a71
deleted: sha256:c497ee682f8262de408c6f12917672455e38c8f710704a7b090e2fd51756eba6
deleted: sha256:02c055ef67f5904019f43a41ea5f099996d8e7633749b6e606c400526b2c4b33
untagged: discourse/base:2.0.20220128-1817
untagged: discourse/[email protected]:dcb4eb8e41a2e84f776f80587f308d167a54ad7ff4ba616199891828bbd4ddae
deleted: sha256:bcd525e1be918b0c4e9bf19495943eb8b7cb548d073b9f3ad23c714d814c1808
deleted: sha256:0586eaea867ec10dddd5fca8f81e17cba7f952270c5ff596230ec12033b3c6d1
deleted: sha256:c35314905abc8c9c72a22fb56b1cabf20df44788f7438da5c8d9b56d037e32c3
deleted: sha256:7d0ebbe3f5d26c1b5ec4d5dbb6fe3205d7061f9735080b0162d550530328abd6
deleted: sha256:73460cdc27d4133c601563777240899fb33ecc7f7477b16f5031553de368208f
deleted: sha256:e34987cfb7c91bff520e060d9e4f791e76295a4b6839dc1684cf87f0aea79c2a
deleted: sha256:c0704d4ce2b4b1b395895db07af5dd040bac1099c6e7dc6c634e144d55215458
deleted: sha256:9b70fca9c051383c6b74a2a21804cbb967e3fd49c8f88f9ff12109e95af27fb3
deleted: sha256:87c8a1d8f54f3aa4e05569e8919397b65056aa71cdf48b7f061432c98475eee9
untagged: discourse/base:2.0.20220413-0411
untagged: discourse/[email protected]:bd13d6869319791c8379143cc8a1c4cfc71d5406dd7e606dffdd40da04d4ed1b
deleted: sha256:ab71a5d974602eaf772a3e07b44ae981b85a36927d231f06e539e631d3db3e92
deleted: sha256:bb449b86e88550855d381f04c9341c1ab39498127043d18c9a66fbdc3b85982e
deleted: sha256:51855ced24070ab6ec11f2675db73131b3b3a469a0f63cd5eb7742189b838b38
deleted: sha256:608f3a074261105f129d707e4d9ad3d41b5baa94887f092b7c2857f7274a2fce

Total reclaimed space: 20.57GB

帮助你清理了超过 20 G。

这个命令可以没事运行下。