我有多个Atlassian产品的容器;JIRA,Bitbucket和Confluence。当我尝试访问运行中的容器时,通常使用:
JIRA
Bitbucket
Confluence
docker exec -it -u root ${DOCKER_CONTAINER} bash
使用此命令,我可以照常访问,但是运行脚本提取和压缩日志文件后,我将无法再访问该容器。
这是第一个失败点,脚本每周运行一次(由Jenkins安排)。
docker cp ${CLEAN_UP_SCRIPT} ${DOCKER_CONTAINER}:/tmp/${CLEAN_UP_SCRIPT} if [ $? -eq 0 ]; then docker exec -it -u root ${DOCKER_CONTAINER} bash -c "cd ${LOG_DIR} && /tmp/compressOldLogs.sh ${ARCHIVE_FILE}" fi
当脚本对Bitbucket容器执行这两行时,结果是:
unable to find user root: no matching entries in passwd file
它在’docker cp’命令上失败,但仅在Bitbucket容器上失败。脚本运行后,“ bitbucket”(在Dockerfile中定义)和“ root”用户均无法访问该容器。
我能够/etc/passwd从容器中复制出来,并且它包含了预期的所有用户。尝试通过uid访问时,出现以下错误:
/etc/passwd
rpc error: code = 2 desc = oci runtime error: exec failed: process_linux.go:75: starting setns process caused "fork/exec /proc/self/exe: no such file or directory"
FROM java:openjdk-8-jre ENV BITBUCKET_HOME /var/atlassian/application-data/bitbucket ENV BITBUCKET_INSTALL_DIR /opt/atlassian/bitbucket ENV BITBUCKET_VERSION 4.12.0 ENV DOWNLOAD_URL https://downloads.atlassian.com/software/stash/downloads/atlassian-bitbucket-${BITBUCKET_VERSION}.tar.gz ARG user=bitbucket ARG group=bitbucket ARG uid=1000 ARG gid=1000 RUN mkdir -p $(dirname $BITBUCKET_HOME) \ && groupadd -g ${gid} ${group} \ && useradd -d "$BITBUCKET_HOME" -u ${uid} -g ${gid} -m -s /bin/bash ${user} RUN mkdir -p ${BITBUCKET_HOME} \ && mkdir -p ${BITBUCKET_HOME}/shared \ && chmod -R 700 ${BITBUCKET_HOME} \ && chown -R ${user}:${group} ${BITBUCKET_HOME} \ && mkdir -p ${BITBUCKET_INSTALL_DIR}/conf/Catalina \ && curl -L --silent ${DOWNLOAD_URL} | tar -xz --strip=1 -C "$BITBUCKET_INSTALL_DIR" \ && chmod -R 700 ${BITBUCKET_INSTALL_DIR}/ \ && chown -R ${user}:${group} ${BITBUCKET_INSTALL_DIR}/ ${BITBUCKET_INSTALL_DIR}/bin/setenv.sh USER ${user}:${group} EXPOSE 7990 EXPOSE 7999 WORKDIR $BITBUCKET_INSTALL_DIR CMD ["bin/start-bitbucket.sh", "-fg"]
此问题是由 docker引擎错误 引起的,但已被 私人跟踪 ,Docker要求用户重新启动引擎!
该错误似乎可能已超过两年!
https://success.docker.com/article/ucp-health-checks-fail-unable-to-find- user-nobody-no-matching-entries-in-passwd-file- observed
https://forums.docker.com/t/unable-to-find-user-root-no-matching-entries-in- passwd-file/26545/7
…我能说的是,某人正在竭尽全力获得更多资金。