diff --git a/act/container/docker_run.go b/act/container/docker_run.go index 4f606a24..d7f54d35 100644 --- a/act/container/docker_run.go +++ b/act/container/docker_run.go @@ -435,6 +435,11 @@ func (cr *containerReference) mergeJobOptions(ctx context.Context, config *conta } } + if len(jobConfig.Config.Hostname) > 0 { + logger.Debugf("--hostname %v", jobConfig.Config.Hostname) + config.Hostname = jobConfig.Config.Hostname + } + return config, hostConfig, nil } diff --git a/act/container/docker_run_test.go b/act/container/docker_run_test.go index 368a5627..6b47ef6f 100644 --- a/act/container/docker_run_test.go +++ b/act/container/docker_run_test.go @@ -258,9 +258,10 @@ func TestMergeJobOptions(t *testing.T) { }{ { name: "ok", - options: "--volume /foo:/bar --volume /frob:/nitz --volume somevolume --tmpfs /tmp:exec,noatime", + options: "--volume /foo:/bar --volume /frob:/nitz --volume somevolume --tmpfs /tmp:exec,noatime --hostname alternatehost", config: &container.Config{ - Volumes: map[string]struct{}{"somevolume": {}}, + Volumes: map[string]struct{}{"somevolume": {}}, + Hostname: "alternatehost", }, hostConfig: &container.HostConfig{ Binds: []string{"/foo:/bar", "/frob:/nitz"},