Use container name for volumes.

This commit is contained in:
Marcos Lilljedahl
2017-10-06 10:21:41 -03:00
parent eebe638227
commit 2f625c1bcc
2 changed files with 4 additions and 3 deletions

View File

@@ -224,8 +224,9 @@ func (d *docker) CopyToContainer(containerName, destination, fileName string, co
}
func (d *docker) DeleteContainer(name string) error {
err := d.c.ContainerRemove(context.Background(), name, types.ContainerRemoveOptions{Force: true, RemoveVolumes: true})
d.c.VolumeRemove(context.Background(), name, true)
return d.c.ContainerRemove(context.Background(), name, types.ContainerRemoveOptions{Force: true, RemoveVolumes: true})
return err
}
type CreateContainerOpts struct {
@@ -328,7 +329,7 @@ func (d *docker) CreateContainer(opts CreateContainerOpts) (err error) {
if err != nil {
return
}
h.Binds = []string{fmt.Sprintf("%s:/var/lib/docker", opts.SessionId)}
h.Binds = []string{fmt.Sprintf("%s:/var/lib/docker", opts.ContainerName)}
defer func() {
if err != nil {

View File

@@ -1,4 +1,4 @@
ARG VERSION=docker:17-dind
ARG VERSION=docker:stable-dind
FROM ${VERSION}
RUN apk add --no-cache git tmux py2-pip apache2-utils vim build-base gettext-dev curl bash-completion bash util-linux jq openssh