I've created a fairly standard asp.net core app which I'm hosting inside Docker. This runs locally and now I'm attempting to use VSTS to build and deploy to Azure. The build step is failing with the message:
Service 'coredockerapi' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder145772260/obj/Docker/publish: no such file or directory
Here is the full log output from VSTS:
2017-11-18T11:52:07.4647720Z ##[section]Starting: Build Repo and create container
2017-11-18T11:52:07.5468610Z ==============================================================================
2017-11-18T11:52:07.5514890Z Task : Docker Compose
2017-11-18T11:52:07.5550720Z Description : Build, push or run multi-container Docker applications. Task can be used with Docker or Azure Container registry.
2017-11-18T11:52:07.5606920Z Version : 0.4.7
2017-11-18T11:52:07.5628440Z Author : Microsoft Corporation
2017-11-18T11:52:07.5655390Z Help : [More Information](https://go.microsoft.com/fwlink/?linkid=848006)
2017-11-18T11:52:07.5678480Z ==============================================================================
2017-11-18T11:52:09.5543380Z 50f571c1-89b9-4b2f-8ea8-097b0966e534 exists true
2017-11-18T11:52:10.4809920Z [command]/usr/local/bin/docker-compose -f /opt/vsts/work/1/s/DemoCoreDocker/docker-compose.yml -p DemoDocker run --rm -T coredockerapi
2017-11-18T11:52:10.8401740Z Creating network "demodocker_default" with the default driver
2017-11-18T11:52:10.9847570Z Building coredockerapi
2017-11-18T11:52:11.0663980Z Step 1/6 : FROM microsoft/aspnetcore:2.0
2017-11-18T11:52:12.3621450Z 2.0: Pulling from microsoft/aspnetcore
2017-11-18T11:52:27.7530280Z Digest: sha256:b5e62c20e77b287b014fc0182f0e21dc1bba7aa0a42ac40338e303fdb5b49638
2017-11-18T11:52:27.7774720Z Status: Downloaded newer image for microsoft/aspnetcore:2.0
2017-11-18T11:52:27.7814270Z ---> 757f574feed9
2017-11-18T11:52:27.7883450Z Step 2/6 : ARG source
2017-11-18T11:52:27.8732530Z ---> Running in bc9b4aa5e33b
2017-11-18T11:52:28.0333270Z ---> 612c57db7df1
2017-11-18T11:52:28.0598310Z Removing intermediate container bc9b4aa5e33b
2017-11-18T11:52:28.0636200Z Step 3/6 : WORKDIR /app
2017-11-18T11:52:28.3684690Z ---> fc4ab62cecd6
2017-11-18T11:52:28.3904360Z Removing intermediate container baedca1c9c5d
2017-11-18T11:52:28.3935980Z Step 4/6 : EXPOSE 80
2017-11-18T11:52:28.5164070Z ---> Running in c8bbbf929c3a
2017-11-18T11:52:28.6861730Z ---> 578c84507512
2017-11-18T11:52:28.7087730Z Removing intermediate container c8bbbf929c3a
2017-11-18T11:52:28.7172780Z Step 5/6 : COPY ${source:-obj/Docker/publish} .
2017-11-18T11:52:28.7256500Z Service 'coredockerapi' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder145772260/obj/Docker/publish: no such file or directory
2017-11-18T11:52:28.7798470Z ##[error]Creating network "demodocker_default" with the default driver
2017-11-18T11:52:28.7901050Z ##[error]Building coredockerapi
2017-11-18T11:52:28.8022370Z ##[error]Service 'coredockerapi' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder145772260/obj/Docker/publish: no such file or directory
2017-11-18T11:52:28.8334530Z [command]/usr/local/bin/docker-compose -f /opt/vsts/work/1/s/DemoCoreDocker/docker-compose.yml -p DemoDocker down
2017-11-18T11:52:29.2414990Z Removing network demodocker_default
2017-11-18T11:52:29.4374050Z ##[error]/usr/local/bin/docker-compose failed with return code: 1
2017-11-18T11:52:29.5268820Z ##[section]Finishing: Build Repo and create container
Here is my docker-compose.yml
version: '3'
services:
coredockerapi:
image: coredockerapi
build:
context: ./CoreDockerAPI
dockerfile: Dockerfile
Thank you.
if somebody still have issue when running compose build or up - with error message:
Service 'php' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder...
Issues in my side is due at .dockerignore where folder to copy was referenced. Just remove line of folder need to copy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With