gpt4 book ai didi

python - 构建 docker 镜像时出现错误消息 "Error processing tar file(exit status 1)"

转载 作者:太空宇宙 更新时间:2023-11-04 12:24:58 24 4
gpt4 key购买 nike

Docker 文件:

FROM centos:6.7

RUN yum -y groupinstall 'Development Tools'

RUN mkdir /compose-portal

ADD roche-ui /compose-portal/roche-ui

ADD http://www.python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz /compose-portal/

WORKDIR "/compose-portal/Python-2.7.6"

ADD . ./configure

WORKDIR "/compose-portal"

RUN curl --silent --location https://rpm.nodesource.com/setup_5.x | bash -

RUN yum -y install nodejs

WORKDIR "/compose-portal/roche-ui"

RUN npm install; npm install -g bower; bower --allow-root install; exit 0

EXPOSE 3000

ENTRYPOINT npm start

出现以下错误:

Error message while building a docker image "Error processing tar file(exit status 1): Error setting up pivot dir: mkdir /var/lib/docker/overlay/58a0a77992c4abd3328a5a6ee62abd5c5dedcb1a06858e829beed6c707a08634/merged/compose-portal/Python-2.7.6/configure/.pivot_root902123111: not a directory"

最佳答案

ADD 一个远程 tar 文件,并尝试自动解压为目录
添加 http://www.python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz/compose-portal/
但是 docker 不会自动从远程地址解压 tar。

If is a local tar archive in a recognized compression format (identity, gzip, bzip2 or xz) then it is unpacked as a directory. Resources from remote URLs are not decompressed. When a directory is copied or unpacked, it has the same behavior as tar -x, the result is the union of:

来自:https://docs.docker.com/engine/reference/builder/#add

也许你应该手动解压它。

关于python - 构建 docker 镜像时出现错误消息 "Error processing tar file(exit status 1)",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45005260/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com