Neo4j Raspberry PI Docker映像-挂载的conf目录不会覆盖默认的conf

时间:2020-04-15 22:32:52

标签: docker neo4j pi

在Raspberry Pi上运行的ARM体系结构没有针对neo4j的docker镜像,因此我已经构建了一个镜像,并且在我的Pi Kubernetes集群中运行时可以正常运行。我可以执行运行的pod和cypher-shell登录。

我无法从其他Pod访问7474或76887端口中的任何一个,所以我相信这是因为默认conf文件正在localhost上侦听,并且我需要使用/ conf上安装的dbms项覆盖它,以覆盖dbms.default_listen_address = 0.0 .0.0。

执行完Pod后,我可以看到已挂载的/ conf目录和neo4j.conf文件。但它似乎并没有使用它。

有人对我在做什么错有任何想法。

这是我的Dockerfile供参考

FROM ubuntu:20.04

ENV NEO4J_HOME="/var/lib/neo4j" \
    NEO4J_EDITION=community

RUN apt-get update && \
    apt-get install -y wget gnupg1 curl apt-transport-https ca-certificates gosu

RUN wget -O - https://debian.neo4j.com/neotechnology.gpg.key | apt-key add - && \
    echo "deb https://debian.neo4j.com stable 4.0" | tee /etc/apt/sources.list.d/neo4j.list && \
    curl -L --fail --silent --show-error "https://github.com/krallin/tini/releases/download/v0.18.0/tini-arm64" > /sbin/tini && \
    chmod +x /sbin/tini && \
    apt-get update

RUN apt-get install -y neo4j

RUN addgroup --system neo4j && adduser --system --no-create-home --home ${NEO4J_HOME} --ingroup neo4j neo4j

RUN mkdir ${NEO4J_HOME}/logs && \
    mv ${NEO4J_HOME}/data /data && \
    mv ${NEO4J_HOME}/logs /logs

RUN chown -R neo4j:neo4j /data && \
    chmod -R 777 /data && \
    chown -R neo4j:neo4j /logs && \
    chmod -R 777 /logs && \
    chown -R neo4j:neo4j ${NEO4J_HOME} && \
    chmod -R 777 ${NEO4J_HOME}

RUN ln -s /data ${NEO4J_HOME}/data && \
    ln -s /logs ${NEO4J_HOME}/logs

ENV PATH ${NEO4J_HOME}/bin:$PATH
WORKDIR ${NEO4J_HOME}
VOLUME /data /logs
COPY docker-entrypoint.sh /docker-entrypoint.sh

EXPOSE 7474 7687

ENTRYPOINT ["/sbin/tini", "-g", "--", "/docker-entrypoint.sh"]
CMD ["neo4j"]

还有我的POD YML

apiVersion: v1
kind: Pod
metadata:
  name: rojopro-neo4j-pod
  labels: 
    app: rojopro-neo4j-pod
spec:
  containers:
    - name: rojopro-neo4j-pod
      image: 192.168.0.110:30000/rojopro-neo4j-arm
      ports:
        - containerPort: 7474
          name: "http"
        - containerPort: 7687
          name: "bolt"
      volumeMounts:
        - mountPath: "/data"
          name: neo4j-data
        - mountPath: "/logs"
          name: neo4j-logs
        - mountPath: "/conf"
          name: neo4j-conf
  imagePullSecrets:
    - name: docker-registry-secret
  volumes:
    - name: neo4j-data
      persistentVolumeClaim:
        claimName: pvc-neo4j-data
    - name: neo4j-conf
      persistentVolumeClaim:
        claimName: pvc-neo4j-conf
    - name: neo4j-logs
      persistentVolumeClaim:
        claimName: pvc-neo4j-logs

0 个答案:

没有答案