Skip to content

Commit

Permalink
Use container name for volumes.
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosnils committed Oct 6, 2017
1 parent eebe638 commit 2f625c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/dind/Dockerfile.dind
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 2f625c1

Please sign in to comment.