Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when Build sample Todoapi contianer #24

Closed
InoueKonoha opened this issue Dec 4, 2018 · 3 comments
Closed

Error when Build sample Todoapi contianer #24

InoueKonoha opened this issue Dec 4, 2018 · 3 comments

Comments

@InoueKonoha
Copy link

Follow the Guide Step by Step

When buile image vndg/todoapi, Error occures

Step 13/20 : RUN dotnet restore -nowarn:msb3202,nu1503
 ---> Running in 446fcef1b174
MSBUILD : error MSB1011: Specify which project or solution file to use because this folder contains more than one project or solution file.
The command '/bin/sh -c dotnet restore -nowarn:msb3202,nu1503' returned a non-zero code: 1
Step 14/20 : RUN dotnet build --no-restore -c Release -o /app
 ---> Running in 039bbdd99b2b
Microsoft (R) Build Engine version 15.8.169+g1ccb72aefa for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1011: Specify which project or solution file to use because this folder contains more than one project or solution file.
The command '/bin/sh -c dotnet build --no-restore -c Release -o /app' returned a non-zero code: 1

After editing sample/Todoapi/Dockerfile by adding detail project name to restore/build/publish cmds

FROM microsoft/dotnet:2.1.5-aspnetcore-runtime-alpine AS base
WORKDIR /app

ARG service_version
ENV SERVICE_VERSION ${service_version:-0.0.1}

ARG api_version
ENV API_VERSION ${api_version:-1.0}

ENV ASPNETCORE_URLS http://+:80
EXPOSE 80

FROM microsoft/dotnet:2.1.403-sdk-alpine AS build
WORKDIR .
COPY . .

WORKDIR /samples/TodoApi

RUN dotnet restore NetCoreKit.Samples.TodoApi.csproj -nowarn:msb3202,nu1503
RUN dotnet build NetCoreKit.Samples.TodoApi.csproj --no-restore -c Release -o /app

FROM build AS publish
RUN dotnet publish NetCoreKit.Samples.TodoApi.csproj--no-restore -c Release -o /app

FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "NetCoreKit.Samples.TodoApi.dll"]

build complete successfully.

@thangchung
Copy link
Member

@InoueKonoha Thank you for your finding. I believe that it works now, please have a try with the changes.

thangchung added a commit that referenced this issue Dec 7, 2018
thangchung added a commit that referenced this issue Dec 7, 2018
@thangchung
Copy link
Member

It should work now mate, please help to check

@InoueKonoha
Copy link
Author

InoueKonoha commented Dec 7, 2018

@thangchung It works, Thx for updating : )

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

No branches or pull requests

2 participants