0

I am looking for any input to an issue I am experiencing in my ADO pipeline. Below is an example of the first part of the Dockerfile (all that is needed for demonstration) that keeps failing:

FROM harbor.xyz.biz/foo/bar/sdk:6.0-alpine AS publish
ENV IS_DOCKER=true
WORKDIR /src

COPY . ./
WORKDIR /src/SpecChannelAirport.Database.Deploy

RUN dotnet restore --configfile ../NuGet.config
RUN dotnet build --no-restore
RUN dotnet publish

Now when I set the ENV_VAR DOCKER_BUILDKIT=0 then the pipeline will build the image just fine and without issue; this is because it is using the legacy docker build, which is technically deprecated functionality. However, when this value is set to 1, which it is by default, then the docker-buildx is used, and it causes a very generic error to occur on the last line of the Dockerfile:

 > [7/7] RUN dotnet publish:
------
Dockerfile:10
--------------------
   8 |     RUN dotnet restore --configfile ../NuGet.config
   9 |     RUN dotnet build --no-restore
  10 | >>> RUN dotnet publish
  11 |     
  12 |     # FROM harbor.xyz.biz/foo/bar/server:2019
--------------------
ERROR: failed to solve: failed to prepare urqxwwwnadtw7fx2jwt6eszan as u720dwirlzaast49cej32ujs1: invalid argument 

I am using buildx-v0.10.4.linux-amd64 plugin (installed at path /usr/local/lib/docker/cli-plugins/) from github, on my build agent which is an Ubuntu 20.04 docker container, with Docker version 23.0.1 and Docker Compose version 2.17.2.

I was not able to find much in the way of this issue online and am not exactly sure what it could be. If I comment out the last line of the Dockerfile, it will build fine, even when using the buildx plugin, so I feel that something has to be going on between the way that the legacy build and the current buildx is interacting or affecting the way that the dotnet publish command is operating.

Does anyone have any ideas or insight to this kind of problem?

AsapHogFtw
  • 181
  • 1
  • 1
  • 8

0 Answers0