【问题标题】:Wercker deploy returns 404 for docker pushWercker 部署为 docker push 返回 404
【发布时间】:2017-11-14 06:06:27
【问题描述】:

第一次使用 Wercker,我使用的是internal/docker-push。当我运行部署步骤时,我从 docker-hub 收到 404 错误。

ERROR Error interacting with this repository: wluce/statler-waldorf-corp-team-service PUT https://registry.hub.docker.com/v1/repositories/wluce/statler-waldorf-corp-team-service/ returned 404 

这不是我第一次运行此步骤,并且以前也可以使用。图像存在并且是here

我不知道会发生什么变化。

这是我用来执行构建和部署的wercker.yml 文件。

box: microsoft/dotnet:2.0.0-sdk-2.0.2
no-response-timeout: 10
build:
  steps: 
    - script:
        name: restore
        cwd: src/StatlerWaldorfCorp.TeamService
        code: dotnet restore
    - script:
        name: build
        cwd: src/StatlerWaldorfCorp.TeamService
        code: dotnet build  

    - script:
        name: test-restore
        cwd: test/StatlerWaldorfCorp.TeamService.Tests
        code: dotnet restore
    - script:
        name: test-build
        cwd: test/StatlerWaldorfCorp.TeamService.Tests
        code: dotnet build
    - script:
        name: test-run
        cwd: test/StatlerWaldorfCorp.TeamService.Tests
        code: dotnet test

    - script:
        name: integration-test-restore
        cwd: test/StatlerWaldorfCorp.TeamService.Tests.Integration
        code: dotnet restore
    - script:
        name: integration-test-build
        cwd: test/StatlerWaldorfCorp.TeamService.Tests.Integration
        code: dotnet build
    - script:
        name: integration-test-run
        cwd: test/StatlerWaldorfCorp.TeamService.Tests.Integration
        code: dotnet test

    - script:
        name: publish
        cwd: src/StatlerWaldorfCorp.TeamService
        code: dotnet publish -o publish
    - script:
        name: copy binary
        cwd: src/StatlerWaldorfCorp.TeamService
        code: cp -r . $WERCKER_OUTPUT_DIR/app 

deploy:
  box: microsoft/aspnetcore:2.0.0
  steps:
    - internal/docker-push:
        cwd: $WERCKER_OUTPUT_DIR/app
        username: $DOCKER_USERNAME
        password: $DOCKER_PASSWORD
        repository: wluce/statler-waldorf-corp-team-service
        registry: https://registry.hub.docker.com
        entrypoint: "/pipeline/source/app/docker_entrypoint.sh"

【问题讨论】:

  • 我已将此问题交叉发布到 wercker 公共 slack 频道。我也遇到了同样的问题。更改帐户密码有帮助吗?
  • 我确实试过了,不,它没有帮助。

标签: docker dockerhub wercker


【解决方案1】:

正如 Wercker slack 频道和@cggaldes 建议的那样,解决方案是在步骤定义中设置完整的注册表地址,例如:

- internal/docker-push:
    registry: https://registry.hub.docker.com/v2   <-- This
    repository: org/repo
    username: $DOCKER_USER
    password: $DOCKER_PASS
    ...

显然internal/docker-push 默认使用最近更改/损坏的 v1。

【讨论】:

    【解决方案2】:

    在内部/docker-push 步骤中, 只需添加附加 v2 的注册表,让 wercker 像这样使用 v2 注册表 api

        repository: gapostolov/course-repo
        registry: https://registry.hub.docker.com/v2
    

    【讨论】:

      猜你喜欢
      • 2023-03-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多