我正在使用以下Dockerfile來使用Docker構建Solr。安裝目錄時的Docker用戶權限
FROM solr:5.5
ENV SOLR_HOME=/opt/solr/server/solr/cores
RUN mkdir ${SOLR_HOME}
RUN chown -R solr:solr ${SOLR_HOME}
VOLUME ["${SOLR_HOME}"]
EXPOSE 8983
我嘗試運行以下命令泊塢窗安裝一個主機目錄的容器:
docker run --restart=always -d --name solr-demo \
--privileged=true -p 8983:8983 \
-v /data/solr_demo:/opt/solr/server/solr/cores \
solr-test:latest
我也複製所需solr.xml
文件到data/solr_demo
。當我運行docker run
命令我碰到下面的錯誤:
stat: cannot stat ‘/opt/solr/server/solr/cores’: No such file or directory 42146d74b446ba4784fd197688e3210f294aad8755ae730cc559132720bcc35a
Error response from daemon: Container 42146d74b446ba4784fd197688e3210f294aad8755ae730cc559132720bcc35a is restarting, wait until the container is running
什麼'LS -ld /數據/主機上solr_demo'的輸出?另外,docker run的輸出是什麼--rm --privileged = true solr-test:latest ls -l/opt/solr/server/solr/cores'? – BMitch
您好請找到輸出[root @ ip-10-0-2-15 data]#ls -ld/data/solr-demo1 drwxr-xr-x。 2 root root 21 Jun 7 12:20/data/solr-demo1 [root @ ip-10-0-2-15 build]#docker run --rm --privileged = true solr-test:latest ls -l/opt/solr/server/solr/cores 共0 –