复制或添加命令未在 docker 集线器上执行

copy or add command not executed on docker hub

此 docker 文件在我的膝上型电脑上按预期工作。但如果我在 docker hub 上使用自动构建,它会失败。

FROM ubuntu
# Install required software via apt and pip
RUN apt-get -y update && \
    apt-get install -y \
    awscli \
    python \
    python-pip \
    software-properties-common \
 && add-apt-repository ppa:ubuntugis/ppa \
 && apt-get -y update \
 && apt-get install -y \
    gdal-bin \
 && pip install boto3

# Copy Build Thumbnail script to Docker image and add execute permissions
COPY build-thumbnails.py build-thumbnails.py

RUN chmod +x build-thumbnails.py

错误是:

Step 6/7 : COPY build-thumbnails.py build-thumbnails.py
COPY failed: stat /var/lib/docker/tmp/docker-builder259560514/build-thumbnails.py: no such file or directory

回购在这里... https://github.com/shantanuo/docker/blob/master/batch/Dockerfile

为什么复制或添加命令不适用于自动构建?

似乎其他人也有同样的问题,请看这里: https://forums.docker.com/t/docker-build-failing-on-docker-hub/76191/2

The solution is to set the build context appropriately so that the relative path >in the Dockerfile COPY is correct.

In your Docker Hub repository go to “Builds” and click on “Configure Automated >Builds”. There you can set the “Build Context” for each build rule.

也请检查此页面上的最后一个答案: https://github.com/docker/hub-feedback/issues/811

如果有帮助请告诉我!