Skip to content

Commit

Permalink
fix: move env variables to runOptions
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
  • Loading branch information
89luca89 authored and pascalbreuninger committed Feb 19, 2024
1 parent 362c499 commit 6cccd29
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 8 additions & 0 deletions pkg/devcontainer/single.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ func (r *runner) runContainer(
}
}

// add environment variables that signals that we are in a remote container
// (vscode compatibility) and specifically that we are using devpod.
if runOptions.Env == nil {
runOptions.Env = make(map[string]string)
}
runOptions.Env["DEVPOD"] = "true"
runOptions.Env["REMOTE_CONTAINERS"] = "true"

// check if docker
dockerDriver, ok := r.Driver.(driver.DockerDriver)
if ok {
Expand Down
5 changes: 0 additions & 5 deletions pkg/driver/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,6 @@ func (d *dockerDriver) RunDockerDevContainer(
"--sig-proxy=false",
}

// add environment variables that signals that we are in a remote container
// (vscode compatibility) and specifically that we are using devpod.
args = append(args, "--env", "DEVPOD=true")
args = append(args, "--env", "REMOTE_CONTAINERS=true")

// add ports
for _, appPort := range parsedConfig.AppPort {
intPort, err := strconv.Atoi(appPort)
Expand Down

0 comments on commit 6cccd29

Please sign in to comment.