Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[Known Bug in platform] sudo docker-compose -f docker-compose.ci.build.yml up is error #344

Closed
bendise opened this issue Sep 22, 2017 · 3 comments

Comments

@bendise
Copy link

bendise commented Sep 22, 2017

sudo docker-compose -f docker-compose.ci.build.yml up
error result:
Step 5/6 : COPY ${source:-obj/Docker/publish} .
ERROR: Service 'webstatus' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder195861528/obj/Docker/publish: no such file or directory

mac os

@CESARDELATORRE
Copy link
Collaborator

CESARDELATORRE commented Sep 22, 2017

When you get that error it is probably because you got oher previous errors when compiling the bits from the "build container"
This is related to this BUG in "dotnet publish" (.NET CLI itself) when running within a build container. and FIX already done, but will be available soon:
BUG: https://github.com/Microsoft/msbuild/issues/2153#issuecomment-305375162
FIX: dotnet/corefx#23539

The point is that this bug/error happens randomly because it is a race condition from the dotnet stdout using the container.
If you get this error, you'll need to build the bits and create the Docker Images on your OS (Windows or Mac or Linux), instead of the "build container".
You can use the scripts available at:
https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/cli-mac
https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/cli-windows
https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/cli-linux

Also, in the near future, when it is supported by Visual Studio, we'll switch from that "build container" to multi-stage containers (https://docs.docker.com/engine/userguide/eng-image/multistage-build/) which don't really need this explicit "build container".

Hope it helps. :)

@CESARDELATORRE CESARDELATORRE changed the title sudo docker-compose -f docker-compose.ci.build.yml up is error [Known Bug in platform] sudo docker-compose -f docker-compose.ci.build.yml up is error Sep 22, 2017
@bendise
Copy link
Author

bendise commented Sep 22, 2017

@CESARDELATORRE thank you! but build error。 project.json dont auto creat,why?
zhangboleitekiMacBook-Pro:eShopOnContainers zhangbolei$ sh -vx cli-mac/build-bits.sh
#!/bin/sh

projectList=(
"../src/Services/Catalog/Catalog.API"
"../src/Services/Basket/Basket.API"
"../src/Services/Ordering/Ordering.API"
"../src/Services/Identity/Identity.API"
"../src/Web/WebMVC"
"../src/Web/WebSPA"
"../src/Web/WebStatus"
)

  • projectList=("../src/Services/Catalog/Catalog.API" "../src/Services/Basket/Basket.API" "../src/Services/Ordering/Ordering.API" "../src/Services/Identity/Identity.API" "../src/Web/WebMVC" "../src/Web/WebSPA" "../src/Web/WebStatus")

pushd $(pwd)/../src/Web/WebSPA
pwd
++ pwd

  • pushd /Users/zhangbolei/documents/eshop/eShopOnContainers/../src/Web/WebSPA
    cli-mac/build-bits.sh: line 14: pushd: /Users/zhangbolei/documents/eshop/eShopOnContainers/../src/Web/WebSPA: No such file or directory
    npm install
  • npm install
    npm WARN saveError ENOENT: no such file or directory, open '/Users/zhangbolei/package.json'
    npm WARN enoent ENOENT: no such file or directory, open '/Users/zhangbolei/package.json'
    npm WARN zhangbolei No description
    npm WARN zhangbolei No repository field.
    npm WARN zhangbolei No README data
    npm WARN zhangbolei No license field.

up to date in 3.048s
npm rebuild node-sass

  • npm rebuild node-sass
    popd
  • popd
    cli-mac/build-bits.sh: line 17: popd: directory stack empty

for project in "${projectList[@]}"
do
echo -e "\e[33mWorking on $(pwd)/$project"
echo -e "\e[33m\tRemoving old publish output"
pushd $(pwd)/$project
rm -rf obj/Docker/publish
echo -e "\e[33m\tBuilding and publishing projects"
dotnet publish -o obj/Docker/publish -c Release
popd
done

  • for project in '"${projectList[@]}"'
    pwd
    ++ pwd
  • echo -e '\e[33mWorking on /Users/zhangbolei/documents/eshop/eShopOnContainers/../src/Services/Catalog/Catalog.API'
    -e \e[33mWorking on /Users/zhangbolei/documents/eshop/eShopOnContainers/../src/Services/Catalog/Catalog.API
  • echo -e '\e[33m\tRemoving old publish output'
    -e \e[33m Removing old publish output
    pwd
    ++ pwd
  • pushd /Users/zhangbolei/documents/eshop/eShopOnContainers/../src/Services/Catalog/Catalog.API
    cli-mac/build-bits.sh: line 23: pushd: /Users/zhangbolei/documents/eshop/eShopOnContainers/../src/Services/Catalog/Catalog.API: No such file or directory
  • rm -rf obj/Docker/publish
  • echo -e '\e[33m\tBuilding and publishing projects'
    -e \e[33m Building and publishing projects
  • dotnet publish -o obj/Docker/publish -c Release
    '/Users/zhangbolei/Documents/eshop/eShopOnContainers' does not contain a project.json file
  • popd
    cli-mac/build-bits.sh: line 27: popd: directory stack empty
  • for project in '"${projectList[@]}"'
    pwd
    ++ pwd
  • echo -e '\e[33mWorking on /Users/zhangbolei/documents/eshop/eShopOnContainers/../src/Services/Basket/Basket.API'
    -e \e[33mWorking on /Users/zhangbolei/documents/eshop/eShopOnContainers/../src/Services/Basket/Basket.API
  • echo -e '\e[33m\tRemoving old publish output'
    -e \e[33m Removing old publish output
    pwd
    ++ pwd
  • pushd /Users/zhangbolei/documents/eshop/eShopOnContainers/../src/Services/Basket/Basket.API
    cli-mac/build-bits.sh: line 23: pushd: /Users/zhangbolei/documents/eshop/eShopOnContainers/../src/Services/Basket/Basket.API: No such file or directory
  • rm -rf obj/Docker/publish
  • echo -e '\e[33m\tBuilding and publishing projects'
    -e \e[33m Building and publishing projects
  • dotnet publish -o obj/Docker/publish -c Release
    '/Users/zhangbolei/Documents/eshop/eShopOnContainers' does not contain a project.json file
  • popd
    cli-mac/build-bits.sh: line 27: popd: directory stack empty
  • for project in '"${projectList[@]}"'
    pwd
    ++ pwd
  • echo -e '\e[33mWorking on /Users/zhangbolei/documents/eshop/eShopOnContainers/../src/Services/Ordering/Ordering.API'
    -e \e[33mWorking on /Users/zhangbolei/documents/eshop/eShopOnContainers/../src/Services/Ordering/Ordering.API
  • echo -e '\e[33m\tRemoving old publish output'
    -e \e[33m Removing old publish output
    pwd
    ++ pwd
  • pushd /Users/zhangbolei/documents/eshop/eShopOnContainers/../src/Services/Ordering/Ordering.API
    cli-mac/build-bits.sh: line 23: pushd: /Users/zhangbolei/documents/eshop/eShopOnContainers/../src/Services/Ordering/Ordering.API: No such file or directory
  • rm -rf obj/Docker/publish
  • echo -e '\e[33m\tBuilding and publishing projects'
    -e \e[33m Building and publishing projects
  • dotnet publish -o obj/Docker/publish -c Release
    '/Users/zhangbolei/Documents/eshop/eShopOnContainers' does not contain a project.json file
  • popd
    cli-mac/build-bits.sh: line 27: popd: directory stack empty
  • for project in '"${projectList[@]}"'
    pwd
    ++ pwd
  • echo -e '\e[33mWorking on /Users/zhangbolei/documents/eshop/eShopOnContainers/../src/Services/Identity/Identity.API'
    -e \e[33mWorking on /Users/zhangbolei/documents/eshop/eShopOnContainers/../src/Services/Identity/Identity.API
  • echo -e '\e[33m\tRemoving old publish output'
    -e \e[33m Removing old publish output
    pwd
    ++ pwd
  • pushd /Users/zhangbolei/documents/eshop/eShopOnContainers/../src/Services/Identity/Identity.API
    cli-mac/build-bits.sh: line 23: pushd: /Users/zhangbolei/documents/eshop/eShopOnContainers/../src/Services/Identity/Identity.API: No such file or directory
  • rm -rf obj/Docker/publish
  • echo -e '\e[33m\tBuilding and publishing projects'
    -e \e[33m Building and publishing projects
  • dotnet publish -o obj/Docker/publish -c Release
    '/Users/zhangbolei/Documents/eshop/eShopOnContainers' does not contain a project.json file
  • popd
    cli-mac/build-bits.sh: line 27: popd: directory stack empty
  • for project in '"${projectList[@]}"'
    pwd
    ++ pwd
  • echo -e '\e[33mWorking on /Users/zhangbolei/documents/eshop/eShopOnContainers/../src/Web/WebMVC'
    -e \e[33mWorking on /Users/zhangbolei/documents/eshop/eShopOnContainers/../src/Web/WebMVC
  • echo -e '\e[33m\tRemoving old publish output'
    -e \e[33m Removing old publish output
    pwd
    ++ pwd
  • pushd /Users/zhangbolei/documents/eshop/eShopOnContainers/../src/Web/WebMVC
    cli-mac/build-bits.sh: line 23: pushd: /Users/zhangbolei/documents/eshop/eShopOnContainers/../src/Web/WebMVC: No such file or directory
  • rm -rf obj/Docker/publish
  • echo -e '\e[33m\tBuilding and publishing projects'
    -e \e[33m Building and publishing projects
  • dotnet publish -o obj/Docker/publish -c Release
    '/Users/zhangbolei/Documents/eshop/eShopOnContainers' does not contain a project.json file
  • popd
    cli-mac/build-bits.sh: line 27: popd: directory stack empty
  • for project in '"${projectList[@]}"'
    pwd
    ++ pwd
  • echo -e '\e[33mWorking on /Users/zhangbolei/documents/eshop/eShopOnContainers/../src/Web/WebSPA'
    -e \e[33mWorking on /Users/zhangbolei/documents/eshop/eShopOnContainers/../src/Web/WebSPA
  • echo -e '\e[33m\tRemoving old publish output'
    -e \e[33m Removing old publish output
    pwd
    ++ pwd
  • pushd /Users/zhangbolei/documents/eshop/eShopOnContainers/../src/Web/WebSPA
    cli-mac/build-bits.sh: line 23: pushd: /Users/zhangbolei/documents/eshop/eShopOnContainers/../src/Web/WebSPA: No such file or directory
  • rm -rf obj/Docker/publish
  • echo -e '\e[33m\tBuilding and publishing projects'
    -e \e[33m Building and publishing projects
  • dotnet publish -o obj/Docker/publish -c Release
    '/Users/zhangbolei/Documents/eshop/eShopOnContainers' does not contain a project.json file
  • popd
    cli-mac/build-bits.sh: line 27: popd: directory stack empty
  • for project in '"${projectList[@]}"'
    pwd
    ++ pwd
  • echo -e '\e[33mWorking on /Users/zhangbolei/documents/eshop/eShopOnContainers/../src/Web/WebStatus'
    -e \e[33mWorking on /Users/zhangbolei/documents/eshop/eShopOnContainers/../src/Web/WebStatus
  • echo -e '\e[33m\tRemoving old publish output'
    -e \e[33m Removing old publish output
    pwd
    ++ pwd
  • pushd /Users/zhangbolei/documents/eshop/eShopOnContainers/../src/Web/WebStatus
    cli-mac/build-bits.sh: line 23: pushd: /Users/zhangbolei/documents/eshop/eShopOnContainers/../src/Web/WebStatus: No such file or directory
  • rm -rf obj/Docker/publish
  • echo -e '\e[33m\tBuilding and publishing projects'
    -e \e[33m Building and publishing projects
  • dotnet publish -o obj/Docker/publish -c Release
    '/Users/zhangbolei/Documents/eshop/eShopOnContainers' does not contain a project.json file
  • popd
    cli-mac/build-bits.sh: line 27: popd: directory stack empty

remove old docker images:

images=$(docker images --filter=reference="eshop/" -q)
docker images --filter=reference="eshop/
" -q
++ docker images '--filter=reference=eshop/*' -q

  • images=
    if [ -n "$images" ]; then
    docker rm $(docker ps -a -q) -f
    echo "Deleting eShop images in local Docker repo"
    echo $images
    docker rmi $(docker images --filter=reference="eshop/*" -q) -f
    fi
  • '[' -n '' ']'

No need to build the images, docker build or docker compose will

do that using the images and containers defined in the docker-compose.yml file.

@CESARDELATORRE
Copy link
Collaborator

Closing this one as we now use Docker Multi-Stage builds and the "build container" is no longer needed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants