1
0
mirror of https://github.com/bingohuang/docker-labs.git synced 2025-10-05 09:53:21 +08:00

Change import paths

Add session cleanup
This commit is contained in:
Jonathan Leibiusky (@xetorthio)
2016-10-08 10:25:10 +02:00
parent 0d693b344c
commit b6b849e2c6
9 changed files with 32 additions and 9 deletions

View File

@@ -4,7 +4,7 @@ import (
"log"
"strings"
ptypes "github.com/xetorthio/play-with-docker/types"
ptypes "github.com/franela/play-with-docker/types"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
@@ -39,6 +39,16 @@ func CreateNetwork(name string) error {
return nil
}
func DeleteNetwork(id string) error {
err := c.NetworkRemove(context.Background(), id)
if err != nil {
return err
}
return nil
}
func GetExecConnection(id string, ctx context.Context) (*types.HijackedResponse, error) {
conf := types.ExecConfig{Tty: true, AttachStdin: true, AttachStderr: true, AttachStdout: true, Cmd: []string{"sh"}}
resp, err := c.ContainerExecCreate(ctx, id, conf)