Error building cartservice
See original GitHub issueHello 😃
I cloned the code and I am trying to build the cartservice docker image on my ubuntu VM but I have the following error :
$ docker build -t cartservice .
Sending build context to Docker daemon 427.5kB
Step 1/10 : FROM mcr.microsoft.com/dotnet/sdk:5.0 as builder
---> 933354c487f6
Step 2/10 : WORKDIR /app
---> Using cache
---> 84bb85aa284d
Step 3/10 : COPY . .
---> Using cache
---> 73dcdd68b1c3
Step 4/10 : RUN dotnet publish -r linux-musl-x64 --self-contained true -c release -o /cartservice
---> Running in d2a103e15c70
Microsoft (R) Build Engine version 16.8.0+126527ff1 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
Restored /app/cartservice.csproj (in 1.22 min).
/app/tests/CartServiceTests.cs(19,7): error CS0246: The type or namespace name 'Xunit' could not be found (are you missing a using directive or an assembly reference?) [/app/cartservice.csproj]
/app/tests/CartServiceTests.cs(29,10): error CS0246: The type or namespace name 'FactAttribute' could not be found (are you missing a using directive or an assembly reference?) [/app/cartservice.csproj]
/app/tests/CartServiceTests.cs(29,10): error CS0246: The type or namespace name 'Fact' could not be found (are you missing a using directive or an assembly reference?) [/app/cartservice.csproj]
/app/tests/CartServiceTests.cs(54,10): error CS0246: The type or namespace name 'FactAttribute' could not be found (are you missing a using directive or an assembly reference?) [/app/cartservice.csproj]
/app/tests/CartServiceTests.cs(54,10): error CS0246: The type or namespace name 'Fact' could not be found (are you missing a using directive or an assembly reference?) [/app/cartservice.csproj]
/app/tests/CartServiceTests.cs(96,10): error CS0246: The type or namespace name 'FactAttribute' could not be found (are you missing a using directive or an assembly reference?) [/app/cartservice.csproj]
/app/tests/CartServiceTests.cs(96,10): error CS0246: The type or namespace name 'Fact' could not be found (are you missing a using directive or an assembly reference?) [/app/cartservice.csproj]
The command '/bin/sh -c dotnet publish -r linux-musl-x64 --self-contained true -c release -o /cartservice' returned a non-zero code: 1
Anything I missed please ?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
What causes the cart service failure in this Angular 13 app?
One trick with error messages is to sometimes use a different browser. With firefox I have error this.cartService is undefined .
Read more >Set up Errors Inbox - New Relic Developers
Under Select entities, click Add for each of the following services to include it in the workload: geek-shop-cart-service; geek-shop-catalogue-service; geek- ...
Read more >Building a Laravel App with TDD - Honeybadger Developer Blog
In this tutorial, learn how to build a Laravel app using TDD. ... Honeybadger includes error tracking with a whole suite of amazing ......
Read more >How To Build An E-Commerce Site With Angular 11 ...
Cart Service #. The cart is responsible for maintaining the quantity of items added and the order Id. Making API calls to get...
Read more >express-http-error - npm
WIP: Express HTTP Error. Build Status · Code Climate · Test Coverage. An opinionated RESTful HTTP error handler intended for use in Express....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Great to hear it works as expected, thanks for following up.
For your bonus question, there is an open issue https://github.com/GoogleCloudPlatform/microservices-demo/issues/428 to re-enable these .NET unit tests, looks like there is some work to do to have them running properly.
Closing this current issue for now.
Hello @mathieu-benoit and thank you for your help !
Indeed, your commands are working well. I investigated a little bit and it appears that I copied the
src/cartservice
in a separate folder withcp -r src/cartservice/*
before building the image : and so, the little hidden.dockerignore
file was not part of my directory, and I guess this caused the error because of this line : once I retrieved the.dockerignore
file, my build was ok !Bonus question : I saw that these were commented here : is this because of the time it takes ?
Thanks !