diff --git a/dktest.go b/dktest.go index e30e4e9..751ed60 100644 --- a/dktest.go +++ b/dktest.go @@ -68,13 +68,14 @@ func runImage(ctx context.Context, lgr Logger, dc client.ContainerAPIClient, img opts Options) (ContainerInfo, error) { c := ContainerInfo{Name: genContainerName(), ImageName: imgName} createResp, err := dc.ContainerCreate(ctx, &container.Config{ - Image: imgName, - Labels: map[string]string{label: "true"}, - Env: opts.env(), - Entrypoint: opts.Entrypoint, - Cmd: opts.Cmd, - Volumes: opts.volumes(), - Hostname: opts.Hostname, + Image: imgName, + Labels: map[string]string{label: "true"}, + Env: opts.env(), + Entrypoint: opts.Entrypoint, + Cmd: opts.Cmd, + Volumes: opts.volumes(), + Hostname: opts.Hostname, + ExposedPorts: opts.ExposedPorts, }, &container.HostConfig{ PublishAllPorts: true, PortBindings: opts.PortBindings, diff --git a/options.go b/options.go index 52c5ba3..74a1638 100644 --- a/options.go +++ b/options.go @@ -28,6 +28,7 @@ type Options struct { Cmd []string // If you prefer to specify your port bindings as a string, use nat.ParsePortSpecs() PortBindings nat.PortMap + ExposedPorts nat.PortSet PortRequired bool LogStdout bool LogStderr bool