forked from helmutkemper/iotmaker.docker.builder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfuncContainerRemove.go
More file actions
42 lines (39 loc) · 801 Bytes
/
funcContainerRemove.go
File metadata and controls
42 lines (39 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package iotmakerdockerbuilder
import (
"github.com/helmutkemper/util"
)
// ContainerRemove
//
// English:
//
// Stop and remove the container
//
// Input:
// removeVolumes: removes docker volumes linked to the container
//
// Output:
// err: standard error object
//
// Português:
//
// Parar e remover o container
//
// Entrada:
// removeVolumes: remove os volumes docker vinculados ao container
//
// Saída:
// err: Objeto de erro padrão
func (e *ContainerBuilder) ContainerRemove(removeVolumes bool) (err error) {
if e.containerID == "" {
err = e.getIdByContainerName()
if err != nil {
util.TraceToLog()
return
}
}
err = e.dockerSys.ContainerStopAndRemove(e.containerID, removeVolumes, false, false)
if err != nil {
util.TraceToLog()
}
return
}