编程技术网

关注微信公众号,定时推送前沿、专业、深度的编程技术资料。

 找回密码
 立即注册

QQ登录

只需一步,快速开始

极客时间

Windows错误:运行Docker-Compops时“未设置PWD变量”

作者: sginer 2022-5-12 16:16:11 显示全部楼层 |阅读模式

Windows error: "PWD variable is not set" when running docker-compose up

由于以下错误,我无法在Windows上本地 Boot Hashicup:

WARNING: The PWD variable is not set. Defaulting to a blank string.
Starting docker_compose_db_1 ... done
Starting docker_compose_api_1 ... done
Attaching to docker_compose_db_1, docker_compose_api_1
db_1   |
db_1   | PostgreSQL Database directory appears to contain a database; Skipping initialization
db_1   |
db_1   | 2021-08-10 02:46:22.157 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
db_1   | 2021-08-10 02:46:22.157 UTC [1] LOG:  listening on IPv6 address "::", port 5432
db_1   | 2021-08-10 02:46:22.164 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_1   | 2021-08-10 02:46:22.191 UTC [27] LOG:  database system was shut down at 2021-07-22 19:28:07 UTC
db_1   | 2021-08-10 02:46:22.216 UTC [1] LOG:  database system is ready to accept connections
api_1  | 2021-08-10T02:46:25.058Z [ERROR] Unable to load config file: error="read /config/config.json: is a directory"

I received the same error from both Command Prompt and PowerShell. Following the advice of this stack overflow thread, I fixed it by replacing ${PWD} with . in the docker-compose.yml.

version: '3.7'
services:
  api:
    image: "hashicorpdemoapp/product-api:v4280cf7"
    ports:
      - "19090:9090"
    volumes:
-      - ${PWD}/conf.json:/config/config.json
+      - ./conf.json:/config/config.json

可能值得在说明中提及此修复程序。

该问题来自:hashicorp/terraform-provider-hashicups-pf/issues/2 , 试试查看该项目更多issue.

问题解答

qarmin 2022-5-12 16:49:16 显示全部楼层

感谢@ethancurtiss报告此信息!您想为此错误创建PR吗?这样,您可以为此贡献而获得“信用”。

如果没有,我可以创建一个并合并明天的第一件事 ?

Luo-Kuang 2022-5-12 17:15:59 显示全部楼层

没关系,我不需要信用。您可以进行更改。

腾讯云服务器 阿里云服务器
腾讯云服务器 腾讯云服务器
关注微信
^