Use container name for volumes.
This commit is contained in:
@@ -224,8 +224,9 @@ func (d *docker) CopyToContainer(containerName, destination, fileName string, co
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (d *docker) DeleteContainer(name string) error {
|
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)
|
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 {
|
type CreateContainerOpts struct {
|
||||||
@@ -328,7 +329,7 @@ func (d *docker) CreateContainer(opts CreateContainerOpts) (err error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
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() {
|
defer func() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
ARG VERSION=docker:17-dind
|
ARG VERSION=docker:stable-dind
|
||||||
FROM ${VERSION}
|
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
|
RUN apk add --no-cache git tmux py2-pip apache2-utils vim build-base gettext-dev curl bash-completion bash util-linux jq openssh
|
||||||
|
|||||||
Reference in New Issue
Block a user