Fix docker hub login error when using image ref as target

Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
This commit is contained in:
Tom Chauveau
2021-06-18 22:01:16 +02:00
parent f842f1ed1d
commit 7d1bbcc416
6 changed files with 28 additions and 25 deletions

View File

@@ -37,31 +37,29 @@ import (
// Image source
source: dagger.#Artifact @dagger(input)
// Image registry
registry: {
// Remote registry
target: string | *"https://index.docker.io/v1/" @dagger(input)
// Registry auth
auth: {
// Username
username: string @dagger(input)
// Password or secret
secret: string | bytes @dagger(input)
secret: string @dagger(input)
}
push: #up: [
op.#Load & {from: source},
if registry != _|_ {
if auth != _|_ {
op.#DockerLogin & {
target: registry.target
username: registry.username
secret: registry.secret
target: name
username: auth.username
secret: auth.secret
}
},
op.#PushContainer & {ref: name},
op.#Subdir & {dir: "/dagger"},
op.#Subdir & {dir: "/dagger"},
]
// Image ref