(ctx context.Context, name string, image string, cmd []string, volumes map[string]struct{}, ports nat.PortSet)
| 83 | } |
| 84 | |
| 85 | func (d Docker) Run(ctx context.Context, name string, image string, cmd []string, volumes map[string]struct{}, ports nat.PortSet) error { |
| 86 | resp, err := d.client.ContainerCreate(ctx, &container.Config{Image: image, Volumes: volumes, ExposedPorts: ports, Cmd: cmd}, nil, nil, nil, name) |
| 87 | if err != nil { |
| 88 | return err |
| 89 | } |
| 90 | if err = d.client.ContainerStart(ctx, resp.ID, types.ContainerStartOptions{}); err != nil { |
| 91 | return err |
| 92 | } |
| 93 | return nil |
| 94 | } |
| 95 | |
| 96 | func (d Docker) Copy(ctx context.Context, file string, dest string, container string) error { |
| 97 | srcPath := file |
no outgoing calls