diff --git a/package-lock.json b/package-lock.json index 97c0b89d..74acba55 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "hooks", - "version": "0.7.0", + "version": "0.7.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "hooks", - "version": "0.7.0", + "version": "0.7.1", "license": "MIT", "devDependencies": { "@types/jest": "^27.5.1", diff --git a/package.json b/package.json index 56a725a3..b7f0f872 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hooks", - "version": "0.7.0", + "version": "0.7.1", "description": "Three projects are included - k8s: a kubernetes hook implementation that spins up pods dynamically to run a job - docker: A hook implementation of the runner's docker implementation - A hook lib, which contains shared typescript definitions and utilities that the other packages consume", "main": "", "directories": { diff --git a/packages/docker/src/dockerCommands/container.ts b/packages/docker/src/dockerCommands/container.ts index d9117c9d..082966ac 100644 --- a/packages/docker/src/dockerCommands/container.ts +++ b/packages/docker/src/dockerCommands/container.ts @@ -314,17 +314,16 @@ export async function getContainerEnvValue( } export async function registryLogin(registry?: Registry): Promise { + const configLocation = + env.DOCKER_CONFIG || `${env.RUNNER_TEMP}/.docker_${uuidv4()}` // if registry credentials are not provided, skip login and return default docker config location if (!registry) { - return env.DOCKER_CONFIG || `${env.HOME}/.docker` + return configLocation } const credentials = { username: registry.username, password: registry.password } - - const configLocation = `${env.RUNNER_TEMP}/.docker_${uuidv4()}` - fs.mkdirSync(configLocation) try { await dockerLogin(configLocation, registry.serverUrl, credentials) } catch (error) { diff --git a/releaseNotes.md b/releaseNotes.md index bb77e7c6..39eaa73e 100644 --- a/releaseNotes.md +++ b/releaseNotes.md @@ -1,6 +1,6 @@ ## Features -- conditionally skip docker login step to fallback on default docker config if no registry credentials are provided +- always run docker login and use env-provided docker config location