Skip to content
Snippets Groups Projects
Commit 63b0c056 authored by Jan Semmelink's avatar Jan Semmelink
Browse files

Stop and REMOVE old container

parent 46529904
Branches
Tags
No related merge requests found
...@@ -117,7 +117,7 @@ func stopRunningSamDocker() { ...@@ -117,7 +117,7 @@ func stopRunningSamDocker() {
panic(err) panic(err)
} }
containers, err := cli.ContainerList(context.Background(), types.ContainerListOptions{}) containers, err := cli.ContainerList(context.Background(), types.ContainerListOptions{All: true})
if err != nil { if err != nil {
panic(err) panic(err)
} }
...@@ -139,7 +139,11 @@ func stopRunningSamDocker() { ...@@ -139,7 +139,11 @@ func stopRunningSamDocker() {
if err != nil { if err != nil {
panic(err) panic(err)
} }
log.Printf("Stopped container %s\n", container.ID) err = cli.ContainerRemove(context.Background(), container.ID, types.ContainerRemoveOptions{})
if err != nil {
panic(err)
}
log.Printf("Stopped and removed container %s\n", container.ID)
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment