From 415864da77b71c32154ab7efe49895d4d6a3844b Mon Sep 17 00:00:00 2001 From: bicijinlian Date: Sat, 8 Jan 2022 15:59:05 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Build/Dockerfile.ENV | 8 ++++++-- Build/WebApiPublish/appsettings.Development.json | 2 +- Build/WebApiPublish/appsettings.json | 2 +- DockerStudyApi/appsettings.Development.json | 2 +- DockerStudyApi/appsettings.json | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Build/Dockerfile.ENV b/Build/Dockerfile.ENV index cb3b481..6c10bab 100644 --- a/Build/Dockerfile.ENV +++ b/Build/Dockerfile.ENV @@ -1,6 +1,10 @@ # Deckerfile 环境变量测试 FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS EnvStudy -ENV DockerfileEvn_A=InDockerfile +ENV Dockerfile_version=0.0.2 WORKDIR /app COPY WebApiPublish/ /app/ -ENTRYPOINT ["dotnet", "DockerStudyApi.dll"] \ No newline at end of file +ENTRYPOINT ["dotnet", "DockerStudyApi.dll"] + +# docker build -f Dockerfile.ENV -t study.dockerfile.env.webapi:latest -t study.dockerfile.env.webapi:0.0.1 . +# docker run --rm -p 5051:80 -d --name study.dockerfile.env.webapi.run1 study.dockerfile.env.webapi +# 查看日志 docker logs contain_id -f //使用 -f 参数 实时输出,ctl + c 退出(不影响容器运行) diff --git a/Build/WebApiPublish/appsettings.Development.json b/Build/WebApiPublish/appsettings.Development.json index 8983e0f..63ed6e1 100644 --- a/Build/WebApiPublish/appsettings.Development.json +++ b/Build/WebApiPublish/appsettings.Development.json @@ -2,7 +2,7 @@ "Logging": { "LogLevel": { "Default": "Information", - "Microsoft": "Warning", + "Microsoft": "Information", "Microsoft.Hosting.Lifetime": "Information" } } diff --git a/Build/WebApiPublish/appsettings.json b/Build/WebApiPublish/appsettings.json index a543e33..03f2a22 100644 --- a/Build/WebApiPublish/appsettings.json +++ b/Build/WebApiPublish/appsettings.json @@ -13,7 +13,7 @@ "Logging": { "LogLevel": { "Default": "Information", - "Microsoft": "Warning", + "Microsoft": "Information", "Microsoft.Hosting.Lifetime": "Information" } }, diff --git a/DockerStudyApi/appsettings.Development.json b/DockerStudyApi/appsettings.Development.json index 8983e0f..63ed6e1 100644 --- a/DockerStudyApi/appsettings.Development.json +++ b/DockerStudyApi/appsettings.Development.json @@ -2,7 +2,7 @@ "Logging": { "LogLevel": { "Default": "Information", - "Microsoft": "Warning", + "Microsoft": "Information", "Microsoft.Hosting.Lifetime": "Information" } } diff --git a/DockerStudyApi/appsettings.json b/DockerStudyApi/appsettings.json index a543e33..03f2a22 100644 --- a/DockerStudyApi/appsettings.json +++ b/DockerStudyApi/appsettings.json @@ -13,7 +13,7 @@ "Logging": { "LogLevel": { "Default": "Information", - "Microsoft": "Warning", + "Microsoft": "Information", "Microsoft.Hosting.Lifetime": "Information" } },