diff --git a/build/build.go b/build/build.go index 6b651e96..9b5455a0 100644 --- a/build/build.go +++ b/build/build.go @@ -654,17 +654,6 @@ func (b *Build) runBuildSteps() error { // running containers. defer b.cleanBuildSteps() - // Create the home volume. - vol := volume.New(homeVolume, b.Runner) - if err := vol.Setup(); err != nil { - return err - } - defer func() { - if err := vol.Close(); err != nil { - log.Printf("Failed to delete homevol: %v", err) - } - }() - b.HasMultipleSteps = len(b.Request.Steps) > 1 errors := make(chan error) var finishedChannels []chan struct{} diff --git a/build/build_test.go b/build/build_test.go index 63be4e96..21fe33d2 100644 --- a/build/build_test.go +++ b/build/build_test.go @@ -598,7 +598,6 @@ func TestRunBuildSteps(t *testing.T) { "docker inspect gcr.io/build-output-tag-1", "docker inspect gcr.io/build-output-tag-2", "docker inspect gcr.io/build-output-tag-no-digest", - "docker volume rm homevol", "docker rm -f step_0 step_1", "docker volume rm homevol", }, @@ -1435,7 +1434,6 @@ func TestStart(t *testing.T) { "docker run --volume homevol:/builder/home --env HOME=/builder/home --volume /var/run/docker.sock:/var/run/docker.sock gcr.io/cloud-builders/docker pull gcr.io/my-project/my-builder", dockerRunString(0) + " gcr.io/my-project/my-builder a", "docker inspect gcr.io/build", - "docker volume rm homevol", "docker rm -f step_0", "docker volume rm homevol", "docker run --volume homevol:/builder/home --env HOME=/builder/home --volume /var/run/docker.sock:/var/run/docker.sock gcr.io/cloud-builders/docker push gcr.io/build", @@ -1456,7 +1454,6 @@ func TestStart(t *testing.T) { "docker run --volume homevol:/builder/home --env HOME=/builder/home --volume /var/run/docker.sock:/var/run/docker.sock gcr.io/cloud-builders/docker pull gcr.io/my-project/my-builder", dockerRunString(0) + " gcr.io/my-project/my-builder a", "docker inspect gcr.io/build", - "docker volume rm homevol", "docker rm -f step_0", "docker volume rm homevol", }, diff --git a/localbuilder_main.go b/localbuilder_main.go index b5d70559..25078bc5 100644 --- a/localbuilder_main.go +++ b/localbuilder_main.go @@ -138,6 +138,7 @@ func main() { b := build.New(r, *buildConfig, nil, &buildlog.BuildLog{}, volumeName, true, *push) if !*dryRun { + // Start the spoofed metadata server. log.Println("Starting spoofed metadata server...") if err := metadata.StartServer(r, metadataImageName); err != nil { @@ -174,7 +175,6 @@ func main() { }() go supplyTokenToMetadata(metadataUpdater, r) - } b.Start()