I am building a docker image and need to include some contents from particular url. So I make a curl request and get the contents as a zip. I am able to extract the zip into a folder as well. However in the very next line if I try to copy the folder I get error that such file or folder does not exist. Can someone help me? Below is the docker file. If I do a ls -a after the unzip I can see 2 items drop and amui which is correct. But very next line if I try to copy it fails.
# escape=`
# Setup arguments
ARG BuildConfiguration=Release
ARG ASSEMBLY_VERSION=0.0
ARG FILE_VERSION=0.0.0.0
ARG NUGET_CONFIG=NuGet.config
ARG SYSTEM_ACCESSTOKEN
# base image stage
FROM abc.io/aspnet-runtime:3.1.6 AS base
WORKDIR /app
EXPOSE 80
FROM abc.io/dotnet-build:3.1.6 AS build
ARG BuildConfiguration
ARG ASSEMBLY_VERSION
ARG FILE_VERSION
ARG NUGET_CONFIG
ARG SYSTEM_ACCESSTOKEN
ENV BuildConfiguration=$BuildConfiguration `
ASSEMBLY_VERSION=$ASSEMBLY_VERSION `
FILE_VERSION=$FILE_VERSION `
NUGET_CONFIG=$NUGET_CONFIG `
SYSTEM_ACCESSTOKEN=$SYSTEM_ACCESSTOKEN
WORKDIR /build
RUN Write-Host "BuildConfiguration: ${env:BuildConfiguration}"; `
Write-Host "ASSEMBLY_VERSION: ${env:ASSEMBLY_VERSION}"; `
Write-Host "FILE_VERSION: ${env:FILE_VERSION}"; `
Write-Host "NUGET_CONFIG: ${env:NUGET_CONFIG}"; `
Write-Host "SYSTEM_ACCESSTOKEN: ${env:SYSTEM_ACCESSTOKEN}";
RUN apt-get install -y apt-transport-https
RUN apt-get update
RUN apt-get install -y aspnetcore-runtime-3.1
RUN apt-get install -y curl
RUN apt-get install -y unzip
FROM build as drop
RUN curl -o drop -u sdf@dise.com:ydfesdfasdfdf56pxvwnd5z6445l7kgezpb2lky6ja2g6xvtina4a --request GET 'https://abe.com/ded/c8002d3e-f4a9-4aea-9ab8-230027996c53/_apis/build/builds/1133376/artifacts?artifactName=drop&api-version=6.0&%24format=zip' -L
RUN unzip drop -d amui
COPY amui .
Here is the output of the docker build command. Entire output is not shown for sake of brevity.
100 18.8M 0 18.8M 0 0 757k 0 --:--:-- 0:00:25 --:--:-- 450k
100 20.4M 0 20.4M 0 0 784k 0 --:--:-- 0:00:26 --:--:-- 573k
100 20.7M 0 20.7M 0 0 774k 0 --:--:-- 0:00:27 --:--:-- 543k
100 21.1M 0 21.1M 0 0 759k 0 --:--:-- 0:00:28 --:--:-- 582k
100 21.7M 0 21.7M 0 0 764k 0 --:--:-- 0:00:29 --:--:-- 795k
Removing intermediate container 5cf617b55a61
---> 79d3a513aaf3
Step 25/45 : RUN unzip drop -d amui
---> Running in d1c070949cf9
Archive: drop
creating: amui/drop/
creating: amui/drop/amui/
inflating: amui/drop/SQL/Sql.Template.json
Removing intermediate container d1c070949cf9
---> 73959bf35eca
Step 26/45 : COPY amui src/I.C.AM.C.P
Service 'p.am.ui' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder955237576/amui: no such file or directory