我正在尝试通过docker-compose手动运行一个非常基本的图像,该图像是通过Visual Studio 2017创建的,但是容器退出后立即退出,代码为0。
通过Visual Studio 2017运行相同的作品!
这是我的testapp1的DOCKEFILE
FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
WORKDIR /app
EXPOSE 80
FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /src
COPY testapp1/testapp1.csproj testapp1/
RUN dotnet restore testapp1/testapp1.csproj
COPY . .
WORKDIR /src/testapp1
RUN dotnet build testapp1.csproj -c Release -o /app
FROM build AS publish
RUN dotnet publish testapp1.csproj -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "testapp1.dll"]
我正在尝试从 testapp2 docker-compose运行 testapp1 图像,这里是
version: '3.4'
services:
testapp2:
image: ${DOCKER_REGISTRY}testapp2
build:
context: .
dockerfile: testapp2/Dockerfile
testapp:
image: ${DOCKER_REGISTRY}testapp1:dev
entrypoint: dotnet testapp1.dll
ports:
- "80"
有关如何手动运行容器的任何建议,我们将不胜感激。谢谢。