无法使用docker-compose为OrientDB设置root密码

我在docker-compose中使用最新的orientdb泊坞窗图像。 我需要设置默认的根密码,但它不工作。 我的docker-compose.yml:

orientdb: image: orientdb ports: - "2434:2434" - "2480:2480" - "2424:2424" volumes: - "/mnt/sda1/dockerVolumes/orientdb:/opt/orientdb/databases" environment: - ORIENTDB_ROOT_PASSWORD 

我目前正在运行:

 $ export ORIENTDB_ROOT_PASSWORD=anypw $ docker-compose up -d 

您需要在docker-compose定义密码:

 environment: - ORIENTDB_ROOT_PASSWORD=anypw 

如果你想从docker-compose隐藏你的密码,你可以创builddocker-compose

 environment: - ORIENTDB_ROOT_PASSWORD=${ORIENTDB_ROOT_PASSWORD} 

我已经能够重现您的解决scheme,它的工作原理:

docker-compose.yml

 version: '2' services: orientdb: image: orientdb ports: - "2434:2434" - "2480:2480" - "2424:2424" environment: - ORIENTDB_ROOT_PASSWORD=test 

现在:

 $ docker-compose up -d Creating network ... with the default driver Creating test_orientdb_1 $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d1f0a4a81222 orientdb "server.sh" 31 seconds ago Up 22 seconds 0.0.0.0:2424->2424/tcp, 0.0.0.0:2434->2434/tcp, 0.0.0.0:2480->2480/tcp test_orientdb_1 

用户: root
通过: testing

您可能尝试login,但尚未创build数据库。
在这里输入图像说明

只需创build一个并尝试login。

在这里输入图像说明