docker啓動neo4j拋出組態檔錯誤

2020-08-09 10:23:05

錯誤描述

操作系統版本:ubuntu16.04
neo4j版本:3.5.8

/var/lib/neo4j/bin/neo4j: line 260: /var/lib/neo4j/conf/neo4j.conf: Permission denied

解決辦法

在編排檔案中新增enteypoint,替換原來的啓動命令

neo4j:
    image: neo4j:3.5.8
    container_name: knowledge-neo4j
    privileged: true
    restart: always

    environment:
      - NEO4J_AUTH=neo4j/neo4j123 # or none

    ports:
      - "7474:7474"
      - "7687:7687"

    entrypoint:
      - bash
      - -c
      - chmod u+r conf/neo4j.conf && sed -i 's/#dbms.connectors.default_listen_address=0.0.0.0/dbms.connectors.default_listen_address=0.0.0.0/g' conf/neo4j.conf && bin/neo4j-admin set-initial-password neo4j123; bin/neo4j console

    volumes:
      - "./data:/var/lib/neo4j/data"
      - "./log:/var/lib/neo4j/logs"
  • 參考連線:https://github.com/neo4j/docker-neo4j/issues/223