Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

566
Visualizações
How to delete a docker image?

My project includes a Dockerfile to build an image. I've made modifications to that Dockerfile and want to see if it works. So i closed my program and listed all docker images in powershell using docker image ls -a. I deletetd all unused images using docker rmi -f $(docker images -a -q) and docker image prune -a.

But my image keeps not getting deleted, but simply 'untagged':

Untagged: my_image:latest
Untagged: my_image@sha256:16eb92a476be0...

All containers are stopped and deleted before trying to remove the image.
When i restart my application to build a new image, the old one keeps getting used:

> docker image ls -a
REPOSITORY                     TAG           IMAGE ID            CREATED      
/my_image                      latest        0d79904a74b0        2 months ago

How do i actually physically remove the old image so my application can build a new one?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

At first, you need to delete/stop the running container that is using your image(which one you want to remove).

  • docker ps -a: To see all the running containers in your machine.
  • docker stop <container_id>: To stop a running container.
  • docker rm <container_id>: To remove/delete a docker container(only if it stopped).
  • docker image ls: To see the list of all the available images with their tag, image id, creation time and size.
  • docker rmi <image_id>: To delete a specific image.
  • docker rmi -f <image_id>: To delete a docker image forcefully
  • docker rm -f (docker ps -a | awk '{print$1}'): To delete all the docker container available in your machine
  • docker image rm <image_name>: To delete a specific image

To remove the image, you have to remove/stop all the containers which are using it.

  • docker system prune -a: To clean the docker environment, removing all the containers and images.
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda