我遇到以下问题。
我创建了一个 Blazor WASM 应用程序(一个简单的点击计数器) 我添加了 Docker 支持并遵循本教程将 BLazor Web 程序集容器化
这是我的dockerfile:
因此,当我使用这些命令构建并运行我的dockerfile时,一切都正常。
docker build -t tapcounter .
docker run -p 8070:80 tapcounter
然后我将我的 docker 镜像推送到 docker hub,以供所有人使用。
docker push darkatek7/tapcounter:latest
现在我创建了一个 docker-compose.yml
---
version: '3.4'
services:
tapcounter:
container_name: tapcounter
image: darkatek7/tapcounter # docker image
ports:
- 8070:80 # port used for localhost ip
restart: unless-stopped # restart policy
但是当我运行我的文件时,我收到以下错误:
Attaching to tapcounter
tapcounter | The command could not be loaded, possibly because:
tapcounter | * You intended to execute a .NET application:
tapcounter | The application 'TapCounter.Web.dll' does not exist.
tapcounter | * You intended to execute a .NET SDK command:
tapcounter | No .NET SDKs were found.
tapcounter |
tapcounter | Download a .NET SDK:
tapcounter | https://aka.ms/dotnet-download
tapcounter |
tapcounter | Learn about SDK resolution:
tapcounter | https://aka.ms/dotnet/sdk-not-found
我猜这是因为缺少 nginx 容器,但我无法让任何东西工作。这是我的代码:这是我的 Docker Hub 页面:如有帮助,我们将不胜感激!
ENTRYPOINT ["dotnet", "CRUDCodeTest.CQRS.API.dll"]
并添加 Nginx :
FROM nginx:alpine AS final
WORKDIR /usr/share/nginx/html
COPY --from=publish /app/publish/wwwroot .
COPY nginx.conf /etc/nginx/nginx.con