Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

404
Views
What does remove container mean/do?

I am getting my hands dirty with Containers and Docker. In the world of Docker (or the world of Containers in general), I am trying to understand what "removing a container" means. The mental model I have of a container is that it is a running instance of an image. If a container has stopped executing, what resources is it consuming that need to be freed? I can understand removing the associated image(s) as they consume disk space. Maybe my mental model of a container as "a running instance of an image" is not correct, and there is more to it. If someone could shed some light, I would greatly appreciate it.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You are nearly there. In Docker when a container is run, the docker daemon mounts the images layers using a unionfs. It adds a layer on top of the images layers to track changes that are happening inside of that container. Say a log file is written that is tracked as part of this layer.

By removing a container you remove the resources use to track this layer of changes that the container has done on top of the image.

When a container is running it consumes CPU, memory and the HDD space associated with this layer.

When a container is stopped, the CPU and memory are released but the HDD space is still used. (You can check stopped containers using docker ps -a; this will show you all the containers across all states)

When a stopped container is removed the HDD space is also freed up. Docker also removes all the meta-data(when it was started, where its files are etc) associated with the container when you remove the container.

To have some more fun with this do this:

docker inspect <image_name>:<tag> and see its output.

docker inspect <containerid> and see its output, here containerid should be of a container running off the above image. And see if you can figure out the layers and cross relate them across the image and container.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!