I'm using Docker Buildx to build my images to multiple architectures, as I'm building them on a MacOS (arm64) but want them to run on a Cloud Run (amd64).
I'm running:
$ docker buildx build \
--push \
--platform linux/amd64,linux/arm64 \
--tag stanleysathler/terraform-starter-carts-api:1.0.0 \
--file carts-api/docker/Dockerfile \
./carts-api
It builds and publishes my images to Docker Hub. But then, I want to have a tag latest
pointing to this latest image too. Tried:
$ docker tag \
stanleysathler/terraform-starter-carts-api:1.0.0 \
stanleysathler/terraform-starter-carts-api:latest
$ docker push \
stanleysathler/terraform-starter-carts-api:latest
But I get this:
Error response from daemon: No such image: stanleysathler/terraform-starter-carts-api:1.0.0
The push refers to repository [docker.io/stanleysathler/terraform-starter-carts-api]
An image does not exist locally with the tag: stanleysathler/terraform-starter-carts-api
It feels like Buildx builds the image, publishes it, but don't create the local image.
How can I publish a latest
tag pointing to my latest build using Docker Buildx?