I have a web application which I want to dockerise and release using azure pipelines. I'm already able to build and test but am struggling on releasing it.
Build Pipeline (on build server controlled with VSTS agent):
1) Build using .net core
2) Run unit tests using .net core
3) Build docker image
4) Push to registry
This then automatically triggers my Release Pipeline. The release pipeline has two stages which are create release
and deploy release
.
A non-docker scenario would be to create DLLs (create release
) and deploy on web servers (deploy release
). I'm not sure if/how this applies to docker apps.
Release Pipeline (a separate release agent running on each environment server):
Artifact (CI Build) => DEV => SIT => UAT => PROD
In each of the environments, I do:
1) stop and remove old image/container
2) pull 'latest' tag from repository
3) run new image in docker container.
Question:
How do I create a single, release specific, docker image which can then be pushed to each environment and how do I split the create release
from deploy release
to get this done?
Issues:
If I'm just pulling an image in each pull then I'm just getting the latest tag, I am not sure if I can tag the registry image with the release number? The reason for tagging with a release number/name is so that I can re-deploy a previous release if necessary.
I want to prevent storing all the release images on my DEV/SIT/UAT/PROD servers. The release images need to live in the registry server so that I have a central location to pull them from.