GitVersion is a tool to help you achieve Semantic Versioning on your project.
This image will run GitVersion Command Line tool. It expects the git rempository to be bound at /src
Add the following as the first stage in your multistage docker file
FROM aakashkhanna/dockerized-gitversion:latest as gitversion
Add the following in the file stage of your multistage docker file to extract the version.txt file
COPY --from=gitversion /repo/version.txt /project/
FROM aakashkhanna/dockerized-gitversion:latest as gitversion
FROM python:3.8
COPY --from=gitversion /repo/version.txt /project/
RUN pip install poetry \
&& poetry install \
&& version=`cat version.txt` \
&& version=`sed 's/-/+/1' <<< $version` \
&& echo "Version: ${version}" \
&& poetry version $version \
&& poetry build