我正在按照本指南在 Mac(Big Sur)上启动 DHIS2 的 docker 容器,并且核心容器一直在我身上重复,因为 Tomcatserver.xml
不能被 chowned。这是日志的尾部:
inflating: /usr/local/tomcat/webapps/ROOT/dhis-web-sms-configuration/safari-pinned-tab.svg
inflating: /usr/local/tomcat/webapps/ROOT/dhis-web-sms-configuration/package.json
inflating: /usr/local/tomcat/webapps/ROOT/dhis-web-sms-configuration/favicon.ico
inflating: /usr/local/tomcat/webapps/ROOT/dhis-web-sms-configuration/service-worker.js
inflating: /usr/local/tomcat/webapps/ROOT/dhis-web-sms-configuration/favicon-48x48.png
inflating: /usr/local/tomcat/webapps/ROOT/dhis-web-sms-configuration/manifest.webapp
inflating: /usr/local/tomcat/webapps/ROOT/META-INF/maven/org.hisp.dhis/dhis-web-portal/pom.xml
inflating: /usr/local/tomcat/webapps/ROOT/META-INF/maven/org.hisp.dhis/dhis-web-portal/pom.properties
chown: changing ownership of '/usr/local/tomcat/conf/server.xml': Operation not permitted
chown: changing ownership of '/usr/local/tomcat/conf/server.xml': Operation not permitted
chown: changing ownership of '/usr/local/tomcat/conf/server.xml': Operation not permitted
chown: changing ownership of '/usr/local/tomcat/conf/server.xml': Operation not permitted
chown: changing ownership of '/usr/local/tomcat/conf/server.xml': Operation not permitted
chown: changing ownership of '/usr/local/tomcat/conf/server.xml': Operation not permitted
chown: changing ownership of '/usr/local/tomcat/conf/server.xml': Operation not permitted
chown: changing ownership of '/usr/local/tomcat/conf/server.xml': Operation not permitted
chown: changing ownership of '/usr/local/tomcat/conf/server.xml': Operation not permitted
chown: changing ownership of '/usr/local/tomcat/conf/server.xml': Operation not permitted
chown: changing ownership of '/usr/local/tomcat/conf/server.xml': Operation not permitted
chown: changing ownership of '/usr/local/tomcat/conf/server.xml': Operation not permitted
chown: changing ownership of '/usr/local/tomcat/conf/server.xml': Operation not permitted
chown: changing ownership of '/usr/local/tomcat/conf/server.xml': Operation not permitted
chown: changing ownership of '/usr/local/tomcat/conf/server.xml': Operation not permitted
chown: changing ownership of '/usr/local/tomcat/conf/server.xml': Operation not permitted
chown: changing ownership of '/usr/local/tomcat/conf/server.xml': Operation not permitted
chown: changing ownership of '/usr/local/tomcat/conf/server.xml': Operation not permitted
chown: changing ownership of '/usr/local/tomcat/conf/server.xml': Operation not permitted
chown: changing ownership of '/usr/local/tomcat/conf/server.xml': Operation not permitted
chown: changing ownership of '/usr/local/tomcat/conf/server.xml': Operation not permitted
这是docker-compose.yml
文件:
version: '3'
services:
core:
image: "${DHIS2_CORE_IMAGE}"
user: root
restart: always
volumes:
- ${DHIS2_CORE_CONFIG:-./config/DHIS2_home/dhis.conf}:/DHIS2_home/dhis.conf
- ./config/server.xml:/usr/local/tomcat/conf/server.xml
- ./config/DHIS2_home:/DHIS2_home
environment:
CATALINA_OPTS: "-Dcontext.path='${DHIS2_CORE_CONTEXT_PATH:-}'"
depends_on:
- "db"
db:
image: "mdillon/postgis:10-alpine"
command: "postgres -c max_locks_per_transaction=100"
restart: always
volumes:
- datadb:/var/lib/postgresql/data
environment:
POSTGRES_DB: dhis2
POSTGRES_USER: dhis
POSTGRES_PASSWORD: dhis
gateway:
image: "jwilder/nginx-proxy:alpine"
restart: always
ports:
- "${DHIS2_CORE_PORT}:80"
volumes:
- ./config/nginx.conf:/etc/nginx/nginx.conf:ro
- ./.apps:/data/apps:ro
- /var/run/docker.sock:/tmp/docker.sock:ro
volumes:
datadb:
home:
我在user: root
那里添加了,但没有任何区别。随着容器重新启动,502 Bad Gateway
当我尝试通过http://localhost:8080
. 似乎膨胀文件的用户没有足够的权限对server.xml
文件执行 chown。
有没有办法永久解决这个问题?是否有提升集群的方法或更改容器中用户的有效权限的方法?