Operando con las imágenes

De Wiki de Sistemas Operativos
Saltar a: navegación, buscar

Puedo borrar una imagen de mi repositorio local en cualquier momento:

# docker image rm -f hello-world
Untagged: hello-world:latest
Untagged: hello-world@sha256:1f19634d26995c320618d94e6f29c09c6589d5df3c063287a00e6de8458f8242
Deleted: sha256:05a3bd381fc2470695a35f230afefd7bf978b566253199c4ae5cc96fafa29b37

Comprobamos que ya no esta:

# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE

Puedo volver a descargarla del repositorio principal de docker:

# docker pull hello-world
Using default tag: latest
latest: Pulling from library/hello-world
5b0f327be733: Already exists 
Digest: sha256:07d5f7800dfe37b8c2196c7b1c524c33808ce2e0f74e7aa00e603295ca9a0972
Status: Downloaded newer image for hello-world:latest

Volvemos a comprobar y efectivamente si aparece:

# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
hello-world         latest              05a3bd381fc2        6 weeks ago         1.84kB