mirror of https://github.com/docker/buildx.git
tests: set a dedicated buildx config dir for each worker
This should help reduce any unexpected config conflict between workers. Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
parent
efd7279118
commit
6f394a0691
|
@ -47,6 +47,7 @@ func buildxCmd(sb integration.Sandbox, opts ...cmdOpt) *exec.Cmd {
|
|||
|
||||
if builder := sb.Address(); builder != "" {
|
||||
cmd.Args = append(cmd.Args, "--builder="+builder)
|
||||
cmd.Env = append(cmd.Env, "BUILDX_CONFIG=/tmp/buildx-"+builder)
|
||||
}
|
||||
if context := sb.DockerAddress(); context != "" {
|
||||
cmd.Env = append(cmd.Env, "DOCKER_CONTEXT="+context)
|
||||
|
|
|
@ -50,7 +50,11 @@ func (w *containerWorker) New(ctx context.Context, cfg *integration.BackendConfi
|
|||
"--driver=docker-container",
|
||||
"--driver-opt=network=host",
|
||||
)
|
||||
cmd.Env = append(os.Environ(), "DOCKER_CONTEXT="+w.docker.DockerAddress())
|
||||
cmd.Env = append(
|
||||
os.Environ(),
|
||||
"BUILDX_CONFIG=/tmp/buildx-"+name,
|
||||
"DOCKER_CONTEXT="+w.docker.DockerAddress(),
|
||||
)
|
||||
if err := cmd.Run(); err != nil {
|
||||
return nil, nil, errors.Wrapf(err, "failed to create buildx instance %s", name)
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package workers
|
|||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"os/exec"
|
||||
|
||||
"github.com/moby/buildkit/identity"
|
||||
|
@ -41,6 +42,7 @@ func (c dockerWorker) New(ctx context.Context, cfg *integration.BackendConfig) (
|
|||
name,
|
||||
"--docker", "host="+bk.DockerAddress(),
|
||||
)
|
||||
cmd.Env = append(os.Environ(), "BUILDX_CONFIG=/tmp/buildx-"+name)
|
||||
if err := cmd.Run(); err != nil {
|
||||
return bk, cl, errors.Wrapf(err, "failed to create buildx instance %s", name)
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package workers
|
|||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"os/exec"
|
||||
|
||||
"github.com/moby/buildkit/identity"
|
||||
|
@ -41,6 +42,7 @@ func (w remoteWorker) New(ctx context.Context, cfg *integration.BackendConfig) (
|
|||
"--driver=remote",
|
||||
bk.Address(),
|
||||
)
|
||||
cmd.Env = append(os.Environ(), "BUILDX_CONFIG=/tmp/buildx-"+name)
|
||||
if err := cmd.Run(); err != nil {
|
||||
return nil, nil, errors.Wrapf(err, "failed to create buildx instance %s", name)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue