I'm using the docker client SDK for Go and I'm running to an issue with pushing images to my AWS ECR.
Here is the gist of my func
import (
"github.com/docker/docker/api/types"
dockerclient "github.com/docker/docker/client"
)
func doPush(target string) {
envCli, err := dockerclient.NewEnvClient()
if err != nil {
panic(err)
}
rc, err := envCli.ImagePush(
context.Background(),
target,
types.ImagePushOptions{})
if err != nil {
panic(err)
}
defer rc.Close()
}
My image is tagged something like [regid].dkr.ecr.us-east-1.amazonaws.com/demo:latest but I get the following error:
invalid reference format
If I remove the [:tag] from the image name, it works until I get a
Error response from daemon: Bad parameters and missing X-Registry-Auth: EOF