Skip to content

Commit f70891c

Browse files
DDRBoxmanarekkas
authored andcommitted
Allows setting workingdir (#117)
Signed-off-by: Colin Edwards <[email protected]>
1 parent c11e1bc commit f70891c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

dockertest.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ type RunOptions struct {
132132
Links []string
133133
ExposedPorts []string
134134
ExtraHosts []string
135+
WorkingDir string
135136
Auth dc.AuthConfiguration
136137
PortBindings map[dc.Port][]dc.PortBinding
137138
}
@@ -171,6 +172,7 @@ func (d *Pool) RunWithOptions(opts *RunOptions) (*Resource, error) {
171172
env := opts.Env
172173
cmd := opts.Cmd
173174
ep := opts.Entrypoint
175+
wd := opts.WorkingDir
174176
var exp map[dc.Port]struct{}
175177

176178
if len(opts.ExposedPorts) > 0 {
@@ -219,6 +221,7 @@ func (d *Pool) RunWithOptions(opts *RunOptions) (*Resource, error) {
219221
Cmd: cmd,
220222
Mounts: mounts,
221223
ExposedPorts: exp,
224+
WorkingDir: wd,
222225
},
223226
HostConfig: &dc.HostConfig{
224227
PublishAllPorts: true,

0 commit comments

Comments
 (0)