Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我是否需要在bitbucket管道中运行自定义docker映像?_Docker_Bitbucket_Bitbucket Pipelines_Docker Image - Fatal编程技术网

我是否需要在bitbucket管道中运行自定义docker映像?

我是否需要在bitbucket管道中运行自定义docker映像?,docker,bitbucket,bitbucket-pipelines,docker-image,Docker,Bitbucket,Bitbucket Pipelines,Docker Image,我创建了一个自定义docker映像,如下所示,并将其推送到自定义回购: # Use php as parent image FROM ruby:2.4-slim # Install core prerequisites RUN apt-get update && apt-get install -y php5.6 python-pip python-dev build-essential zip software-properties-common wget # Instal

我创建了一个自定义docker映像,如下所示,并将其推送到自定义回购:

# Use php as parent image
FROM ruby:2.4-slim

# Install core prerequisites
RUN apt-get update && apt-get install -y php5.6 python-pip python-dev build-essential zip software-properties-common wget

# Install awscli
RUN pip install awscli
然后,我将此自定义图像添加到我的bitbucket-pipelines.yml中,如下所示:

image:
  name: xxx/adzooma-ruby:v1
  username: $DOCKER_HUB_USERNAME
  password: $DOCKER_HUB_PASSWORD

pipelines:
  tags:
    release-*:
      - step:
          script:
            - wget https://wordpress.org/latest.tar.gz
...
由于以下原因,我的管道在运行时立即失败:

+ wget https://wordpress.org/latest.tar.gz
bash: wget: command not found

这让我觉得实际上我的docker映像根本没有被使用,因为我在映像中显式安装了wget——那么我的管道语法是否正确,或者我在这里遗漏了一个步骤?

我在您的映像中遇到了几乎相同的问题。问题的原因是docker容器注册表无法捕获本地构建docker映像上的更改。为了解决这个问题,我删除了本地机器和私有docker容器注册表上的图像。重建和重新命名解决了我的问题。也许这也适用于您。

您还必须定义电子邮件地址

image:
  name: account-name/openjdk:8
  username: $DOCKER_HUB_USERNAME
  password: $DOCKER_HUB_PASSWORD
  email: $DOCKER_HUB_EMAIL

请参阅:

docker run-it--rm xxx/adzooma ruby:v1哪个wget的输出是什么?(一些想法:推送不起作用/您推送了一个错误的图像;$PATH被破坏)这些文档似乎表明电子邮件是可选的:“您还可以选择包含一个电子邮件地址,这可能是某些提供商所需要的。”除非“某些提供商”是指Docker Hub!啊,谢谢你,我确实注意到,在第一次构建时,我可以看到它拉动图像,但在随后的一次构建中(我添加了几个缺少的依赖项),它似乎没有这样做,就好像它在使用缓存图像一样。明天我会试试的-谢谢你的提醒。