Fix docker login

pull/10/head 1.7.3
Stefan Scherer 6 years ago
parent ca96f56e6b
commit 9ec13a0053
No known key found for this signature in database
GPG Key ID: 5966AEAC37E957FA

@ -9,8 +9,20 @@ $image = "stefanscherer/whoami"
Write-Host Starting deploy
if (!(Test-Path ~/.docker)) { mkdir ~/.docker }
'{ "experimental": "enabled" }' | Out-File ~/.docker/config.json -Encoding Ascii
docker login -u="$env:DOCKER_USER" -p="$env:DOCKER_PASS"
# "$env:DOCKER_PASS" | docker login --username "$env:DOCKER_USER" --password-stdin
# docker login with the old config.json style that is needed for manifest-tool
$auth =[System.Text.Encoding]::UTF8.GetBytes("$($env:DOCKER_USER):$($env:DOCKER_PASS)")
$auth64 = [Convert]::ToBase64String($auth)
@"
{
"auths": {
"https://index.docker.io/v1/": {
"auth": "$auth64"
}
},
"experimental": "enabled"
}
"@ | Out-File -Encoding Ascii ~/.docker/config.json
$os = If ($isWindows) {"windows"} Else {"linux"}
docker tag whoami "$($image):$os-$env:ARCH-$env:APPVEYOR_REPO_TAG_NAME"

Loading…
Cancel
Save