ScanSkill

docker compose push

docker compose push is used to push service images defined in compose.yaml file to their respective registry/repository.

Syntax

$ docker compose push [options] [SERVICE...]

Here,

OPTIONS:

  • --ignore-push-failures → Push what it can and ignores images with push failures

Examples

  • Push image locally(to the local registry)
services:
	app1:
    build: .
    image: localhost:5000/yourimage
  • Push to Docker Hub
services:
	app2:
    build: .
    image: your-dockerid/yourimage
  • OR combined services
services:
  app1:
    build: .
    image: localhost:5000/yourimage  ## goes to local registry

  app2:
    build: .
    image: your-dockerid/yourimage  ## goes to your repository on Docker Hub