@@ -37,33 +37,27 @@ DOCKER_TAG="git-${VERSION}"
37
37
PRIVATE_REPO=" docker.elastic.co/observability-ci/ecp-elastic-agent-service"
38
38
PRIVATE_IMAGE=" ${PRIVATE_REPO} :${DOCKER_TAG} "
39
39
40
- # TODO: let's avoid accessing vault directly but use the vault plugin itself
41
- # https://github.com/elastic/vault-docker-login-buildkite-plugin does not support
42
- # the `skopeo` command by default but looks for the current installed tools in the runner
43
- # Let's contribute in a follow-up PR to support `skopeo` as well.
44
- DOCKER_REGISTRY_SECRET_PATH=" kv/ci-shared/platform-ingest/docker_registry_prod"
45
- DOCKER_REGISTRY=" docker.elastic.co"
46
- DOCKER_USERNAME_SECRET=$( retry 5 vault kv get -field user " ${DOCKER_REGISTRY_SECRET_PATH} " )
47
- DOCKER_PASSWORD_SECRET=$( retry 5 vault kv get -field password " ${DOCKER_REGISTRY_SECRET_PATH} " )
48
- skopeo login --username " ${DOCKER_USERNAME_SECRET} " --password " ${DOCKER_PASSWORD_SECRET} " " ${DOCKER_REGISTRY} "
49
-
50
40
# download the amd64 and arm64 builds of the image from the previous steps
51
41
buildkite-agent artifact download " build/distributions/**" . --step " packaging-service-container-amd64"
52
42
buildkite-agent artifact download " build/distributions/**" . --step " packaging-service-container-arm64"
53
43
54
- # get the digest information so the manifest reference the images
55
- AMD64_DIGEST=$( skopeo inspect --format " {{.Digest}}" " docker-archive:./build/distributions/elastic-agent-service-$DOCKER_TAG -$BUILD_VERSION -linux-amd64.docker.tar.gz" )
56
- ARM64_DIGEST=$( skopeo inspect --format " {{.Digest}}" " docker-archive:./build/distributions/elastic-agent-service-$DOCKER_TAG -$BUILD_VERSION -linux-arm64.docker.tar.gz" )
44
+ # AMD64
45
+ docker load -i ./build/distributions/elastic-agent-service-$DOCKER_TAG -$BUILD_VERSION -linux-amd64.docker.tar.gz
46
+ docker image tag " elastic-agent-service:$DOCKER_TAG " " $PRIVATE_IMAGE "
47
+ AMD64_DIGEST=$( docker image inspect --format " {{index .RepoDigests 0}}" " $PRIVATE_IMAGE " )
48
+ docker push " $AMD64_DIGEST "
57
49
58
- # copy the images into the private image location with digest (not tag)
59
- skopeo copy --all " docker-archive:./build/distributions/elastic-agent-service-$DOCKER_TAG -$BUILD_VERSION -linux-amd64.docker.tar.gz" " docker://$PRIVATE_REPO @$AMD64_DIGEST "
60
- skopeo copy --all " docker-archive:./build/distributions/elastic-agent-service-$DOCKER_TAG -$BUILD_VERSION -linux-arm64.docker.tar.gz" " docker://$PRIVATE_REPO @$ARM64_DIGEST "
50
+ # ARM64 (overwrites AMD64 tags)
51
+ docker load -i ./build/distributions/elastic-agent-service-$DOCKER_TAG -$BUILD_VERSION -linux-arm64.docker.tar.gz
52
+ docker image tag " elastic-agent-service:$DOCKER_TAG " " $PRIVATE_IMAGE "
53
+ ARM64_DIGEST=$( docker image inspect --format " {{index .RepoDigests 0}}" " $PRIVATE_IMAGE " )
54
+ docker push " $ARM64_DIGEST "
61
55
62
56
# create a new manifest image referencing the source images
63
57
docker buildx imagetools create -t " $PRIVATE_IMAGE " \
64
- " $PRIVATE_REPO @ $ AMD64_DIGEST" \
65
- " $PRIVATE_REPO @ $ ARM64_DIGEST"
66
- skopeo copy --all " docker-daemon: $PRIVATE_IMAGE " " docker:// $PRIVATE_IMAGE "
58
+ " $AMD64_DIGEST " \
59
+ " $ARM64_DIGEST "
60
+ docker push " $PRIVATE_IMAGE "
67
61
68
62
annotate " * Image: $PRIVATE_IMAGE "
69
63
annotate " * Short commit: $VERSION "
0 commit comments