Skip to content

Commit 316dc77

Browse files
authored
Push latest tag whenever a new Docker image is built (#117)
1 parent c017d3d commit 316dc77

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.buildkite/docker-push.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@
33
set -euo pipefail
44

55
version_tag=$(jq -r ".version" ./package.json)
6-
elastic_image="docker.elastic.co/mcp/elasticsearch:$version_tag"
6+
elastic_image="docker.elastic.co/mcp/elasticsearch"
77

88
# build image
99
docker buildx create --use --name builder
1010
docker buildx inspect --bootstrap
11-
docker buildx build -t "$elastic_image" --platform linux/amd64,linux/arm64 --builder builder --load .
11+
docker buildx build -t "$elastic_image:$version_tag" --platform linux/amd64,linux/arm64 --builder builder --load .
12+
docker tag "$elastic_image:$version_tag" "$elastic_image:latest"
1213

1314
# push to docker.elastic.co
1415
ELASTIC_PASSWORD=$(vault read -field=password secret/ci/elastic-mcp-server-elasticsearch/devtoolsmachine)
1516
docker login -u "devtoolsmachine" -p "$ELASTIC_PASSWORD" docker.elastic.co
16-
docker push "$elastic_image"
17+
docker push "$elastic_image:$version_tag"
18+
docker push "$elastic_image:latest"
1719
docker logout docker.elastic.co

0 commit comments

Comments
 (0)