I'm new to Kubernetes, Docker and microservices. I created several nodejs microservices, and use skaffold to build, run and update my deployments. Everything is working so far.
However, when I run docker images
, I realised that I have many instances of the same image. Why is that so?
- Will this take up more space in my disk drive?
- am I doing something wrong?
I just realised that whenever I make changes to my NextJS client application, skaffold will create new images. Why is that so?
Images are unique
This is reflected by the
Image ID
Images uses
Tags
, an image will be the same if they have same Image ID, they can have different TagsNo more space will be used for images with different tags and same Image ID
You can clean them up if you're not using them with
docker image prune
commandI can't say if it's wrong, but definitely it depends on what you want to achieve
Skaffold is just creating a new image with the newest changes and building an updated image, so if this is what you want then it's correct - just need to make sure and create a task to clean-up things that you're not using to save disk space
I hope this answers your question