have a goreleaser yaml in which I have defined a few containers which I want to build and push.
I am successful able to build the docker images, but when I try to push the image. I get this error:
error=
β docker images: failed to publish artifacts: failed to push jammutkarsh/unkey-dagger-health:0.4.7 after 1 tries: failed to push jammutkarsh/unkey-dagg
er-health:0.4.7: exit status 1: push access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorizati
on failed
PS: The creds are correct, I pushed it yesterday when I executing goreleaser locally.
Here's my function:
@func()
release(gitdir: Directory, dockersocket: Socket, ghtoken: string, dockerUser: string, dockerSecret: Secret): Directory {
dag.container()
return dag.goreleaser()
.withGoCache() // Enable Caching for Go Builds
.withSource(gitdir) // to get info related to git tags
.ctr() // Returning Container to mount Docker
.withWorkdir("/mnt/go") // go.mod and goreleaser YAML is `go` dir
.withUnixSocket("/var/run/docker.sock", dockersocket)
.withEnvVariable("GITHUB_TOKEN", ghtoken) // Requireed by goreleaser, incase a package needs to be published
.withSecretVariable("DOCKER_PAT", dockerSecret)
.withRegistryAuth("docker.io", dockerUser, dockerSecret)
.withExec(["goreleaser", "release", "--clean"])
.directory("/mnt/go/dist") // Export the Binary Packages
}
I have used .withRegistryAuth() , withExec() and used terminal() and manually entered the docker login to debug the issue. But in all 3 cases the error is same. I can't push.