Skip to content

Instantly share code, notes, and snippets.

@jesugmz
jesugmz / docker-hub-automated-builds-with-multi-stages.md
Last active November 15, 2022 22:45
Docker Hub automated builds with multi-stages

Docker Hub automated builds with multi-stages

Docker Hub automated builds are nice to build automatically Docker images when code is pushed to the linked git repository but they do not support Docker multi-stages by default.

To do so is needed to override the default commands that Docker Hub uses internally by using hooks.

In this example we have two stages:

  • dev will be built from master branch only
  • prod will be built per git tag