Allow to set env variables through the API

This commit is contained in:
Marcos Lilljedahl
2020-06-19 08:26:12 -03:00
parent 0810809166
commit 833e71330f
4 changed files with 6 additions and 2 deletions

View File

@@ -262,6 +262,7 @@ type CreateContainerOpts struct {
Labels map[string]string
Networks []string
DindVolumeSize string
Envs []string
}
func (d *docker) ContainerCreate(opts CreateContainerOpts) (err error) {
@@ -269,7 +270,7 @@ func (d *docker) ContainerCreate(opts CreateContainerOpts) (err error) {
containerDir := "/opt/pwd"
containerCertDir := fmt.Sprintf("%s/certs", containerDir)
env := []string{fmt.Sprintf("SESSION_ID=%s", opts.SessionId)}
env := append([]string{}, fmt.Sprintf("SESSION_ID=%s", opts.SessionId))
// Write certs to container cert dir
if len(opts.ServerCert) > 0 {