我尝试下载confluence 8.0.2的docker镜像,尝试了几次。当我尝试启动它时,我收到一条令人讨厌的消息,指出文件丢失。当我将容器提交到另一个容器并使用 bash 交互启动它时,我仍然收到该消息。这是我所做的:
[root@seven]# docker pull atlassian/confluence-server:latest
latest: Pulling from atlassian/confluence-server
Digest: sha256:d0264f04a3c1eba7b944a8a81ddb4421cda088db71c94cc2e7d9435034ca4de1
Status: Downloaded newer image for atlassian/confluence-server:latest
docker.io/atlassian/confluence-server:latest
[root@seven]# docker run atlassian/confluence-server:latest
INFO:root:Generating /opt/atlassian/confluence/conf/server.xml from template server.xml.j2
INFO:root:Generating /opt/atlassian/confluence/confluence/WEB-INF/classes/seraph-config.xml from template seraph-config.xml.j2
INFO:root:Generating /opt/atlassian/confluence/confluence/WEB-INF/classes/confluence-init.properties from template confluence-init.properties.j2
INFO:root:Generating /var/atlassian/application-data/confluence/confluence.cfg.xml from template confluence.cfg.xml.j2
INFO:root:User is currently root. Will downgrade run user to confluence
INFO:root:Running Confluence with command '/opt/atlassian/confluence/bin/start-confluence.sh', arguments ['/opt/atlassian/confluence/bin/start-confluence.sh', '-fg']
executing as current user
Cannot find /opt/atlassian/confluence/bin/setclasspath.sh
This file is needed to run this program
图片已于24日更新。也许这是 Atlassian 的某种圣诞幽默。当我尝试在提交的容器中手动运行启动脚本时,错误保持不变;所有文件都存在且可供所有人执行。数据目录由 Confluence 所有者安装并拥有。
当我做某事时
docker 提交 efb3494a609b test_container2
和一个
docker run -ti --entrypoint=bash test_container2
我明白了
confluence@abfe000e75b7:~$ ls /opt/atlassian/confluence/bin/ -la
total 10796
drwxr-xr-x 1 root root 4096 Dec 24 17:17 .
drwxr-xr-x 1 root root 4096 Dec 24 17:17 ..
-rwxr-xr-x 1 root root 1403435 Dec 22 08:56 atlassian-password-cli.jar
-rwxr-xr-x 1 root root 5867298 Dec 22 08:56 bcprov-jdk15on.jar
-rwxr-xr-x 1 root root 34700 Jul 14 18:28 bootstrap.jar
-rwxr-xr-x 1 root root 16840 Jul 14 18:28 catalina.bat
-rwxr-xr-x 1 root root 25294 Jul 14 18:28 catalina.sh
-rwxr-xr-x 1 root root 1703 Jul 14 18:28 catalina-tasks.xml
-rwxr-xr-x 1 root root 2123 Jul 14 18:28 ciphers.bat
-rwxr-xr-x 1 root root 1997 Jul 14 18:28 ciphers.sh
-rwxr-xr-x 1 root root 25410 Jul 14 18:28 commons-daemon.jar
-rwxr-xr-x 1 root root 2040 Jul 14 18:28 configtest.bat
-rwxr-xr-x 1 root root 1922 Jul 14 18:28 configtest.sh
-rwxr-xr-x 1 root root 19078 Dec 22 08:56 confluence-context-path-extractor.jar
-rwxr-xr-x 1 root root 9100 Jul 14 18:28 daemon.sh
-rwxr-xr-x 1 root root 2091 Jul 14 18:28 digest.bat
-rwxr-xr-x 1 root root 1965 Jul 14 18:28 digest.sh
-rwxr-xr-x 1 root root 346 Dec 22 08:55 display-help.bat
-rwxr-xr-x 1 root root 373 Dec 22 08:55 display-help.sh
-rwxr-xr-x 1 root root 3606 Jul 14 18:28 makebase.bat
-rwxr-xr-x 1 root root 3382 Jul 14 18:28 makebase.sh
-rwxr-xr-x 1 root root 165 Dec 22 08:55 'OS X - Run Confluence In Background.command'
-rwxr-xr-x 1 root root 191 Dec 22 08:55 'OS X - Run Confluence In Terminal Window.command'
-rwxr-xr-x 1 root root 167 Dec 22 08:55 'OS X - Stop Confluence.command'
-rwxr-xr-x 1 root root 9941 Dec 22 08:56 service.bat
-rwxr-xr-x 1 root root 3460 Jul 14 18:28 setclasspath.bat
-rwxr-xr-x 1 root root 3708 Jul 14 18:28 setclasspath.sh
-rwxr-xr-x 1 root root 4887 Dec 22 08:55 setenv.bat
-rwxr-xr-x 1 root root 5759 Dec 24 17:17 setenv.sh
-rwxr-xr-x 1 root root 2172 Dec 22 08:55 setjre.bat
-rwxr-xr-x 1 root root 869 Dec 22 08:55 setjre.sh
-rwxr-xr-x 1 root root 2020 Jul 14 18:28 shutdown.bat
-rwxr-xr-x 1 root root 1902 Jul 14 18:28 shutdown.sh
-rwxr-xr-x 1 root root 1185 Dec 22 08:55 start-confluence.bat
-rwxr-xr-x 1 root root 1637 Dec 22 08:55 start-confluence.sh
-rwxr-xr-x 1 root root 2022 Jul 14 18:28 startup.bat
-rwxr-xr-x 1 root root 1904 Jul 14 18:28 startup.sh
-rwxr-xr-x 1 root root 83 Dec 22 08:55 stop-confluence.bat
-rwxr-xr-x 1 root root 860 Dec 22 08:55 stop-confluence.sh
drwxr-xr-x 1 root root 4096 Dec 24 17:16 synchrony
-rwxr-xr-x 1 root root 522859 Dec 22 08:56 synchrony-proxy-watchdog.jar
-rwxr-xr-x 1 root root 2613248 Jul 14 18:28 tcnative-1.dll
-rwxr-xr-x 1 root root 142984 Jul 14 18:28 tomcat9.exe
-rwxr-xr-x 1 root root 126600 Jul 14 18:28 tomcat9w.exe
-rwxr-xr-x 1 root root 47050 Jul 14 18:28 tomcat-juli.jar
-rwxr-xr-x 1 root root 4574 Jul 14 18:28 tool-wrapper.bat
-rwxr-xr-x 1 root root 5540 Jul 14 18:28 tool-wrapper.sh
-rwxr-xr-x 1 root root 112 Dec 22 08:55 user.sh
-rwxr-xr-x 1 root root 2026 Jul 14 18:28 version.bat
-rwxr-xr-x 1 root root 1908 Jul 14 18:28 version.sh
这看起来很不错。 Confluence 用户应该能够执行脚本。
有人有想法吗?
参考下这个:https://www.cnblogs.com/wuxianfeng023/p/17187237.html 给docker运行的时候加上--privileged参数,因为--privileged这个参数就是让你容器内的root用户具备拥有真正的root权限。否则容器内部的root只是外部的一个普通用户权限。