我使用Visual Studio 2017 for MAC运行.netcore2.0 webapi。 我的项目结构如下。
src
--Solution.sln
-- Common
-- commonPrj
-- Common.csproj
--Data
-- QM
-- QM.csproj
--Repo
--Repo.csproj
--Ser
-- Host
-- Api
--api.csproj
我也有DOCKERFILE内容。这是在执行dotnet构建过程时抛出错误,因为构建代理无法解析common.csproj /我认为我的dockerfile定义是错误的。有人可以协助我做这项工作[我在这里尝试了很多选项与dockerfile]>?
#FROM microsoft/aspnetcore-build:2.0 AS build-env
FROM microsoft/aspnetcore
# copy csproj and restore as distinct layers
#COPY *.csproj ./
#RUN dotnet restore
# copy everything else and build
#COPY . ./ ./ ./
#RUN dotnet restore
#RUN dotnet publish -c Release -o out
# build runtime image
#FROM microsoft/aspnetcore:2.0
#WORKDIR /app
#COPY --from=build-env /app/out .
#EXPOSE 5000
COPY ./out /out
WORKDIR /out
#WORKDIR /publish
ENTRYPOINT ["dotnet", "Rando.MortgageCenter.WebAPI.dll"]
我正在尝试使用Docker云环境构建此docker镜像[cloud.docker.com/swarm]
Error Log from docker cloud build
Building in Docker Cloud's infrastructure...
Cloning into '.'...
Warning: Permanently added the RSA host key for IP address '104.192.143.1' to the list of known hosts.
Reset branch 'master'
Your branch is up-to-date with 'origin/master'.
KernelVersion: 4.4.0-93-generic
Arch: amd64
BuildTime: 2017-08-17T22:50:04.828747906+00:00
ApiVersion: 1.30
Version: 17.06.1-ce
MinAPIVersion: 1.12
GitCommit: 874a737
Os: linux
GoVersion: go1.8.3
Starting build of index.docker.io/systreeau/mortgagecenter:latest...
Step 1/4 : FROM microsoft/aspnetcore
---> f79840764591
Step 2/4 : COPY ./out /out
COPY failed: stat /var/lib/docker/tmp/docker-builder177013174/out: no such file or directory
ERROR: Build failed: COPY failed: stat /var/lib/docker/tmp/docker-builder177013174/out: no such file or directory
ERROR: Build failed with exit code 2