我正在尝试使用来自docker的一些实验功能:docker manifest
。为了在CLI中启用它,我更改了config.json
:
{ "experimental": "enabled" }
要推送图像,我尝试了两种选择:
manifest-tol push from-spec manifest.yaml
与manifest.yaml
如下:
image: <my-gitlab>/test:latest
manifests:
- image: <my-gitlab>/test/test-arm:latest
platform:
architecture: arm
os: linux
- image: <my-gitlab>/test/test-amd64:latest
platform:
architecture: amd64
os: linux
我得到的错误:
...
FATA[0002] Couldn't mount blobs for cross-repository push: Blob mount failed to url https://<my-gitlab>/v2/test/...... : HTTP status 401
使用docker manfiest
如下:
docker manifest create $(CI_REGISTRY_IMAGE):$(VERSION) \
$(CI_REGISTRY_IMAGE)/test-amd64:$(VERSION) \
$(CI_REGISTRY_IMAGE)/test-arm:$(VERSION)
docker manifest annotate $(CI_REGISTRY_IMAGE):$(VERSION) $(CI_REGISTRY_IMAGE)/fakedev-amd64:$(VERSION) --arch amd64
docker manifest annotate $(CI_REGISTRY_IMAGE):$(VERSION) $(CI_REGISTRY_IMAGE)/fakedev-arm:$(VERSION) --arch arm
docker manifest push $(CI_REGISTRY_IMAGE):$(VERSION)
我得到的错误:
failed to mount blob test/test-amd64@sha256:06713e398bbf8051c79a3babe0f7ff2a6967b5b5ede4af51dae842ae263ed9a5 to <my-gitlab>/test/test:latest: errors:
denied: requested access to the resource is denied
unauthorized: authentication required
当然,在两种情况下,我都是使用docker login <my-gitlab-registry>
登录的