# Enige advies over hoe ruimte te besparen?

**URL:** https://meta.discourse.org/t/any-advice-on-how-to-save-space/252779
**Category:** Self-hosting
**Tags:** server-resources
**Created:** [24 januari 2023 om 19:44 UTC](https://meta.discourse.org/t/any-advice-on-how-to-save-space/252779 "2023-01-24T19:44:06Z")
**Posts on this page:** 1
**Showing post:** 17

<div class="post-metadata">

### Author: ![debryc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/debryc/32/101652_2.png) [@debryc](https://meta.discourse.org/u/debryc)
#### Post date: [25 januari 2023 om 20:17 UTC](https://meta.discourse.org/t/any-advice-on-how-to-save-space/252779/17 "2023-01-25T20:17:52Z")

</div>

I got additional instructions on how to handle the following:

> [@debryc](#):
>
> [![](https://global.discourse-cdn.com/meta/original/4X/9/5/1/951d5187f8b55188b5923ff51805cda14c18f1b3.jpeg)](https://forums.docker.com/u/rofrano)
> 
> [rofrano](https://forums.docker.com/u/rofrano)[John Rofrano](https://forums.docker.com/u/rofrano)
> 
> [Nov '17](https://forums.docker.com/t/how-to-remove-none-images-after-building/7050/18)
> 
> It is important to understand why you have intermediate untagged images showing as `<none> <none>` in order to avoid them since, as you have seen, you can’t remove them if they are in use.
> 
> The reason untagged images happen is because you built an image, then you changed the `Dockerfile` and built that image again and it reused some of the layers from the previous build. Now you have an untagged image which cannot be deleted because some of it’s layers are being used by a new version of that image.
> 
> The solution is to:
> 
> - Delete the new version of the image
> - Delete the untagged image and
> - Rebuild the new version of the image so that it owns all of the layers.
> 
> You will be left with a single tagged image that contains all of the layers of the previous untagged images and the new image.
> 
> ~jr

The details are:

> [![](https://global.discourse-cdn.com/meta/original/4X/9/5/1/951d5187f8b55188b5923ff51805cda14c18f1b3.jpeg)](https://forums.docker.com/u/rofrano)
> 
> [rofrano](https://forums.docker.com/u/rofrano)[John Rofrano](https://forums.docker.com/u/rofrano)
> 
> 1
> 
> [20h](https://forums.docker.com/t/how-to-remove-none-images-after-building/7050/53?u=debryc)
> 
> The command to remove an image is:
> 
> ```plaintext
> docker rmi {image_name}
> 
> ```
> 
> Where `{image_name}` is the name of the image you want to delete. You can also use the image ID to delete the image (e.g., `docker rmi {image_id}`). This is what you will need to use to delete an image with a name of `<none>`.
> 
> For example, Let’s say you have the following images:
> 
> ```plaintext
> REPOSITORY TAG IMAGE ID CREATED SIZE
> my-new-image latest c18f86ab8daa 12 seconds ago 393MB
> <none> <none> b1ee72ab84ae About a minute ago 393MB
> my-image latest f5a5f24881c3 2 minutes ago 393MB
> 
> ```
> 
> It is possible that the `<none>` image cannot be deleted because the `my-new-image` is using some layers from it. What you need to do is:
> 
> ```plaintext
> docker rmi my-new-image:latest
> docker rmi b1ee72ab84ae
> docker built -t my-new-image .
> 
> ```
> 
> What that does is remove `my-new-image:latest` which is reusing layers from the `<none>` image. It then deletes the `<none>` image using it’s image ID `b1ee72ab84ae`. Finally it rebuilds `my-new-image` creating all of the layers that are needed.
> 
> Also check to make sure that you don’t have stopped containers that are still using the `<none>` “untagged” image. Use `docker ps -a` to see all image including ones that have exited. If so, use `docker rm {container_id}` to remove the container and then try and remove the `<none>` image again.

What do you all think?

---

_[View the full topic](https://meta.discourse.org/t/any-advice-on-how-to-save-space/252779)._
