我正在使用 docker-compose 来运行我的 asp.net api 应用程序。当我使用命令“docker-compose up”时,我收到错误:
Could not determine an appropriate location for storing user secrets. Set the DOTNET_USER_SECRETS_FALLBACK_DIR environment variable to a folder where user secrets should be stored.
在我的 yml 文件中,我有:
version: '3'
services:
kestrel_apache:
build: ./
ports:
- '80:80'
volumes:
- ./app:/root/app
- ./dev.conf:/etc/apache2/sites-available/dev.conf
- ./entrypoint.sh:/entrypoint.sh
entrypoint: ./entrypoint.sh
environment:
APACHE_RUN_DIR: /var/run/apache2
DOTNET_CLI_HOME: /tmp
DOTNET_USER_SECRETS_FALLBACK_DIR: ./secretTest
您可以在底部看到我添加了环境变量并像错误描述的那样定义了它。我确保该文件夹存在。但是,我仍然收到此错误。我究竟做错了什么?