Skip to content

Commit 34b04e3

Browse files
committed
fixing bug on multiple containers simultaneously upgrade. Can't prune multiple times. Replaced with container remove
1 parent 16ab25c commit 34b04e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docker/docker.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ func (cl *Client) ContainerReplace(containerID string, image string, tag string)
596596
return sErr
597597
}
598598

599-
_, remErr := cl.ContainersPrune(filters.NewArgs())
599+
remErr := cl.ContainerRemove(containerID)
600600
if remErr != nil {
601601
if cl.log != nil {
602602
cl.log.Error("failed to remove old container", containerID, remErr)
@@ -613,7 +613,7 @@ func (cl *Client) ContainerRemove(containerID string) error {
613613
ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
614614
defer cancel()
615615

616-
remErr := cl.client.ContainerRemove(ctx, containerID, types.ContainerRemoveOptions{Force: true, RemoveVolumes: true, RemoveLinks: true})
616+
remErr := cl.client.ContainerRemove(ctx, containerID, types.ContainerRemoveOptions{Force: true, RemoveVolumes: true})
617617
if remErr != nil {
618618
if cl.log != nil {
619619
cl.log.Error("failed to remove old container", containerID, remErr)

0 commit comments

Comments
 (0)