diff --git a/local/local.go b/local/local.go index 3922f8b7d..041357d8e 100644 --- a/local/local.go +++ b/local/local.go @@ -237,10 +237,10 @@ func writeStringToTempFile(tempDir, data string) (string, error) { func generateDockerCommand(tempDir, configPath, image, pwd string, job string, dockerSocketPath string, arguments ...string) []string { configPathInsideContainer := fmt.Sprintf("%s/local_build_config.yml", tempDir) core := []string{"docker", "run", "--rm", - "--volume", fmt.Sprintf("%s:/var/run/docker.sock", dockerSocketPath), - "--volume", fmt.Sprintf("%s:%s", configPath, configPathInsideContainer), - "--volume", fmt.Sprintf("%s:%s", pwd, pwd), - "--volume", fmt.Sprintf("%s:/root/.circleci", settings.SettingsPath()), + "--mount", fmt.Sprintf("type=bind,src=%s,dst=/var/run/docker.sock", dockerSocketPath), + "--mount", fmt.Sprintf("type=bind,src=%s,dst=%s", configPath, configPathInsideContainer), + "--mount", fmt.Sprintf("type=bind,src=%s,dst=%s", pwd, pwd), + "--mount", fmt.Sprintf("type=bind,src=%s,dst=/root/.circleci", settings.SettingsPath()), "--workdir", pwd, image, "circleci", "build", "--config", configPathInsideContainer, "--job", job} return append(core, arguments...) diff --git a/local/local_unit_test.go b/local/local_unit_test.go index 9a5ef2b0e..7f30972b5 100644 --- a/local/local_unit_test.go +++ b/local/local_unit_test.go @@ -21,10 +21,10 @@ var _ = Describe("build", func() { "docker", "run", "--rm", - "--volume", "/var/run/docker.sock:/var/run/docker.sock", - "--volume", "/config/path:/tempdir/local_build_config.yml", - "--volume", "/current/directory:/current/directory", - "--volume", home+"/.circleci:/root/.circleci", + "--mount", "type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock", + "--mount", "type=bind,src=/config/path,dst=/tempdir/local_build_config.yml", + "--mount", "type=bind,src=/current/directory,dst=/current/directory", + "--mount", "type=bind,src="+home+"/.circleci,dst=/root/.circleci", "--workdir", "/current/directory", "docker-image-name", "circleci", "build", "--config", "/tempdir/local_build_config.yml",