环境变量

master
bicijinlian 3 years ago
parent 8467b6a438
commit 415864da77

@ -1,6 +1,10 @@
# Deckerfile 环境变量测试 # Deckerfile 环境变量测试
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS EnvStudy FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS EnvStudy
ENV DockerfileEvn_A=InDockerfile ENV Dockerfile_version=0.0.2
WORKDIR /app WORKDIR /app
COPY WebApiPublish/ /app/ COPY WebApiPublish/ /app/
ENTRYPOINT ["dotnet", "DockerStudyApi.dll"] 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 退出(不影响容器运行)

@ -2,7 +2,7 @@
"Logging": { "Logging": {
"LogLevel": { "LogLevel": {
"Default": "Information", "Default": "Information",
"Microsoft": "Warning", "Microsoft": "Information",
"Microsoft.Hosting.Lifetime": "Information" "Microsoft.Hosting.Lifetime": "Information"
} }
} }

@ -13,7 +13,7 @@
"Logging": { "Logging": {
"LogLevel": { "LogLevel": {
"Default": "Information", "Default": "Information",
"Microsoft": "Warning", "Microsoft": "Information",
"Microsoft.Hosting.Lifetime": "Information" "Microsoft.Hosting.Lifetime": "Information"
} }
}, },

@ -2,7 +2,7 @@
"Logging": { "Logging": {
"LogLevel": { "LogLevel": {
"Default": "Information", "Default": "Information",
"Microsoft": "Warning", "Microsoft": "Information",
"Microsoft.Hosting.Lifetime": "Information" "Microsoft.Hosting.Lifetime": "Information"
} }
} }

@ -13,7 +13,7 @@
"Logging": { "Logging": {
"LogLevel": { "LogLevel": {
"Default": "Information", "Default": "Information",
"Microsoft": "Warning", "Microsoft": "Information",
"Microsoft.Hosting.Lifetime": "Information" "Microsoft.Hosting.Lifetime": "Information"
} }
}, },

Loading…
Cancel
Save