liveBook · Manning

Docker push

As explained in Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform

docker push is a Docker CLI command that uploads a tagged Docker image to a container registry.

`docker push` uploads a tagged Docker image to a container registry. It turns an image that exists only on a development computer into one available for later deployment, including deployment to Kubernetes. section 3.12 section 3.9

To publish an image to a private registry:

  • Build the image from a Dockerfile. Create the private registry if this is the first publication; reuse it for later images. section 3.10 section 3.9
  • Tag the local image with the registry URL, image name, and version: `docker tag <existing-image> <registry-url>/<image-name>:<version>`. The registry URL in the tag tells Docker where to push it. section 3.9.2
  • Authenticate with `docker login <registry-url>` using that registry’s credentials, then run `docker push <registry-url>/<image-name>:<version>`. section 3.9.2 section 6.11.2
  • Check the published image in the registry, then use `docker run` to test that the published image boots. section 3.9.2 section 3.9

Publish a versioned microservice image

After building `video-streaming:1`, run `docker tag video-streaming:1 <registry-url>/video-streaming:1`, `docker login <registry-url>`, and `docker push <registry-url>/video-streaming:1`. Replace the placeholder with your registry URL. Increment the version for later builds; if a push fails, first check that the tag contains the correct registry URL. section 6.11.2

Successful authentication may display a warning that supplying a password on the command line is insecure. The initial publishing workflow leaves that security issue for later treatment. section 3.9.2

How Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform covers it

How deep it goes
Works through registry setup, authentication, tagging, pushing, and verification; defers proper handling of the command-line password warning.
Examples
Uses a versioned microservice image, registry-qualified tag, copyable push command, Azure portal check, and run test.
What it assumes
Assumes a locally built image and Docker commands; walks through registry creation, credentials, and the tag needed before pushing.
What you can do after
Operate/configure it to publish a tagged image to a private registry and check for a common tag error.
How it connects
Connects Dockerfile, docker build, docker tag, docker login, container registries, docker run, and Kubernetes deployment.

Also explained in

Compare how 2 books explain docker push →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform. The section links point to the parts of the book it draws on.