Tuesday, 4 June 2019

docker container rm: Remove the container


‘docker container rm {container_name/container_id}’ removes the stopped container from your system.

$docker container rm --help

Usage: docker container rm [OPTIONS] CONTAINER [CONTAINER...]

Remove one or more containers

Options:
  -f, --force     Force the removal of a running container (uses SIGKILL)
  -l, --link      Remove the specified link
  -v, --volumes   Remove the volumes associated with the container


$docker container ls -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                     PORTS               NAMES
c9a1bfa89e1e        jboss/wildfly       "/opt/jboss/wildfly/…"   13 minutes ago      Exited (0) 6 minutes ago                       infallible_elgamal
ecc56427245c        hello-world         "/hello"                 23 hours ago        Exited (0) 23 hours ago                        dazzling_dewdney
$
$docker container rm ecc56427245c
ecc56427245c
$
$docker container ls -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                     PORTS               NAMES
c9a1bfa89e1e        jboss/wildfly       "/opt/jboss/wildfly/…"   13 minutes ago      Exited (0) 6 minutes ago                       infallible_elgamal




Previous                                                 Next                                                 Home

No comments:

Post a Comment