运行mkdir文件夹,添加文件夹/并复制文件夹/在dockerfile中,这些文件不工作

fdbelqdn  于 2021-10-10  发布在  Java
关注(0)|答案(0)|浏览(394)

我一直在尝试在docker中构建服务solr,已经编写了一个dockerfile来构建一个映像,dockerfile中的内容如下。

  1. FROM solr:8.6.3
  2. LABEL maintainer="halloweens"
  3. # create Core
  4. USER root
  5. WORKDIR /opt/solr-8.6.3/server/solr
  6. # RUN mkdir ik_core // didn't work, so I annotated
  7. ADD ik_core/ . // I was trying this way to add this directory into it, COPY as well, didn't work
  8. WORKDIR ik_core
  9. RUN echo 'name=ik_core' > core.properties
  10. # RUN mkdir data // didn't work, so I annotated
  11. # setup the ik-analyzer // this part quite succeeded
  12. WORKDIR /opt/solr-8.6.3/server/solr-webapp/webapp/WEB-INF/lib
  13. ADD ik-analyzer-8.3.0.jar .
  14. ADD solr-core-8.6.3.jar .
  15. ADD solr-dataimporthandler-8.6.3.jar .
  16. ADD solr-dataimporthandler-extras-8.6.3.jar .
  17. ADD solr-solrj-8.6.3.jar .
  18. WORKDIR /opt/solr-8.6.3/server/solr-webapp/webapp/WEB-INF
  19. ADD hotword.dic .
  20. ADD stopword.dic .
  21. ADD IKAnalyzer.cfg.xml .
  22. # add conf
  23. ADD managed-schema /opt/solr-8.6.3/server/solr/ik_core/conf // oop, it's like doesn't have the targer directory, so, didn't work
  24. USER solr
  25. WORKDIR /opt/solr-8.6.3

主要问题是它无法在其中创建新文件夹,也无法将文件夹移动/复制到其中,以下是构建此映像时的一些消息。

  1. Building solr
  2. Step 1/20 : FROM solr:8.6.3
  3. ---> 6cd44b0427c6
  4. Step 2/20 : LABEL maintainer="halloweens"
  5. ---> Using cache
  6. ---> c00102273187
  7. Step 3/20 : USER root
  8. ---> Using cache
  9. ---> bf673ba7db76
  10. Step 4/20 : WORKDIR /opt/solr-8.6.3/server/solr
  11. ---> Using cache
  12. ---> 49944dc42904
  13. Step 5/20 : ADD ik_core/ .
  14. ---> Using cache
  15. ---> a1242656d9b6
  16. Step 6/20 : WORKDIR ik_core
  17. ---> Using cache
  18. ---> 3324f309b66d
  19. Step 7/20 : RUN echo 'name=ik_core' > core.properties
  20. ---> Using cache
  21. ---> 93375111a380
  22. Step 8/20 : WORKDIR /opt/solr-8.6.3/server/solr-webapp/webapp/WEB-INF/lib
  23. ---> Using cache
  24. ---> 090df62ab5f9
  25. Step 9/20 : ADD ik-analyzer-8.3.0.jar .
  26. ---> Using cache
  27. ---> 151144e7e5b2
  28. Step 10/20 : ADD solr-core-8.6.3.jar .
  29. ---> Using cache
  30. ---> 5b12febb071c
  31. Step 11/20 : ADD solr-dataimporthandler-8.6.3.jar .
  32. ---> Using cache
  33. ---> d738b7026a4e
  34. Step 12/20 : ADD solr-dataimporthandler-extras-8.6.3.jar .
  35. ---> Using cache
  36. ---> aa2d0a16524d
  37. Step 13/20 : ADD solr-solrj-8.6.3.jar .
  38. ---> Using cache
  39. ---> 10562eab8c4b
  40. Step 14/20 : WORKDIR /opt/solr-8.6.3/server/solr-webapp/webapp/WEB-INF
  41. ---> Using cache
  42. ---> ce0c98054b6e
  43. Step 15/20 : ADD hotword.dic .
  44. ---> Using cache
  45. ---> de3ad2605a45
  46. Step 16/20 : ADD stopword.dic .
  47. ---> Using cache
  48. ---> c25cc36a0513
  49. Step 17/20 : ADD IKAnalyzer.cfg.xml .
  50. ---> Using cache
  51. ---> e1c19c123f2c
  52. Step 18/20 : ADD managed-schema /opt/solr-8.6.3/server/solr/ik_core/conf
  53. ---> Using cache
  54. ---> f8d6d2dd9ed6
  55. Step 19/20 : USER solr
  56. ---> Using cache
  57. ---> 989221e33b98
  58. Step 20/20 : WORKDIR /opt/solr-8.6.3
  59. ---> Using cache
  60. ---> 5d6c68254e72
  61. Successfully built 5d6c68254e72
  62. Successfully tagged solr_solr:latest
  63. Creating solr ... done

所有者和组是相同的。

  1. total 18308
  2. -rw-r--r-- 1 root root 937 Jul 17 13:31 Dockerfile
  3. -rw-r--r-- 1 halloweens halloweens 6 Oct 28 2020 hotword.dic
  4. -rw-r--r-- 1 halloweens halloweens 9686058 Oct 22 2020 ik-analyzer-8.3.0.jar
  5. -rw-r--r-- 1 halloweens halloweens 589 Oct 28 2020 IKAnalyzer.cfg.xml
  6. drwxr-xr-x 4 halloweens halloweens 30 Jul 17 13:18 ik_core
  7. -rw-r--r-- 1 halloweens halloweens 64795 Nov 5 2020 managed-schema
  8. -rw-r--r-- 1 halloweens halloweens 6369473 Oct 3 2020 solr-core-8.6.3.jar
  9. -rw-r--r-- 1 halloweens halloweens 231329 Oct 3 2020 solr-dataimporthandler-8.6.3.jar
  10. -rw-r--r-- 1 halloweens halloweens 41007 Oct 3 2020 solr-dataimporthandler-extras-8.6.3.jar
  11. -rw-r--r-- 1 halloweens halloweens 11858 Jul 17 12:05 solr.in.sh
  12. -rw-r--r-- 1 halloweens halloweens 2311259 Oct 3 2020 solr-solrj-8.6.3.jar
  13. -rw-r--r-- 1 halloweens halloweens 8 Oct 28 2020 stopword.dic

下面是ik_core文件夹中的内容。

  1. total 0
  2. drwxr-xr-x 2 halloweens halloweens 6 Jul 17 13:18 conf
  3. drwxr-xr-x 2 halloweens halloweens 6 Jul 17 13:13 data

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题