We have a strange issue with our CI/CD pipeline publishing using a docker file and the zip command.
When we run the docker file locally all files are zipped and published to the Azure function.
When we run the file using our CI/CD pipeline four assemblies are left out of the zip file.
The four assemblies are unmanaged code.
They can be seen in the build and publish bin directories.
An extra step to copy them from a sub folder to the publish bin directory as a belt and braces approach has been added to the docker file.
Below is the contents of our docker file
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY . .
WORKDIR “/src/DistanceGenerationApi/Distance.Generation.Api.Functions”
RUN dotnet publish -r win-x64 -c Release /property:GenerateFullPaths=true /consoleloggerparameters:NoSummary -o /app/publish
FROM mcr.microsoft.com/azure-cli:2.10.1
COPY --from=build /app/publish /app/publish
COPY --from=build /app/publish/InsDtxBinaries/. /app/publish/bin/
WORKDIR /app/publish
RUN zip -r functions.zip
ENTRYPOINT az login --service-principal -u {SPUSER} -p {SPPASS} --tenant {SPTENANT} && az functionapp deployment source config-zip -n {FUNCNAME} --src functions.zip -g ${FUNCRG}
What version are you on? Are you using self-managed or GitLab.com?*
- GitLab Enterprise Edition 13.2.3-ee
- Linux runner
- Add the CI configuration from
.gitlab-ci.yml
and other configuration if relevant (e.g. docker-compose.yml)
distance-generation-functions-deploy:
tags:
- linux
- idg
stage: deploy
script:
- docker build --no-cache -t distance-generations-functions-publish
-f DistanceGenerationApi/Distance.Generation.Api.Functions/publish.dockerfile .
- docker run
-e SPUSER=$SPUSER
-e SPPASS=$SPPASS
-e SPTENANT=$SPTENANT
-e FUNCNAME=func-distancegenerationapi
-e FUNCRG=rg-titan-win
--rm distance-generation-functions-publish
only:
refs:
- merge_request
changes:
- DistanceGenerationApi/**/*