Skip to content

πŸ™Œ OpenHands: AI-Driven Development

Fix Docker tagging issue with upper case (#2512)

Boxuan Li89cae8d6b8b7
diff --git a/.github/workflows/ghcr.yml b/.github/workflows/ghcr.yml
index 9e8d6228b3..56e820b192 100644
--- a/.github/workflows/ghcr.yml
+++ b/.github/workflows/ghcr.yml
@@ -214,10 +214,12 @@ jobs:
mv /tmp/${{ matrix.platform }}/${{ matrix.image }}_image_${{ matrix.platform }}.tar .
loaded_image=$(docker load -i ${{ matrix.image }}_image_${{ matrix.platform }}.tar | grep "Loaded image:" | awk '{print $3}')
tags=$(echo ${tags} | tr ' ' '\n')
+ image_name=$(echo "ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}" | tr '[:upper:]' '[:lower:]')
+ echo "image name = $image_name"
for tag in $tags; do
echo "tag = $tag"
- docker tag $loaded_image ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}:${tag}_${{ matrix.platform }}
- docker push ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}:${tag}_${{ matrix.platform }}
+ docker tag $loaded_image $image_name:${tag}_${{ matrix.platform }}
+ docker push $image_name:${tag}_${{ matrix.platform }}
done
create_manifest:
@@ -249,12 +251,14 @@ jobs:
- name: Create and push multi-platform manifest
run: |
+ image_name=$(echo "ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}" | tr '[:upper:]' '[:lower:]')
+ echo "image name = $image_name"
tags=$(echo ${tags} | tr ' ' '\n')
for tag in $tags; do
echo 'tag = $tag'
- docker buildx imagetools create --tag ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}:$tag \
- ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}:${tag}_amd64 \
- ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}:${tag}_arm64
+ docker buildx imagetools create --tag $image_name:$tag \
+ $image_name:${tag}_amd64 \
+ $image_name:${tag}_arm64
done
# FIXME: an admin needs to mark this as non-mandatory, and then we can remove it
diff --git a/containers/build.sh b/containers/build.sh
index dd4eaf7075..5b17a25056 100755
--- a/containers/build.sh
+++ b/containers/build.sh
@@ -10,9 +10,6 @@ tags=()
OPEN_DEVIN_BUILD_VERSION="dev"
-cache_tag_base="buildcache"
-cache_tag="$cache_tag_base"
-
if [[ -n $GITHUB_REF_NAME ]]; then
# check if ref name is a version number
if [[ $GITHUB_REF_NAME =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
@@ -22,8 +19,8 @@ if [[ -n $GITHUB_REF_NAME ]]; then
fi
sanitized=$(echo "$GITHUB_REF_NAME" | sed 's/[^a-zA-Z0-9.-]\+/-/g')
OPEN_DEVIN_BUILD_VERSION=$sanitized
- cache_tag+="-${sanitized}"
- tags+=("$sanitized")
+ tag=$(echo "$sanitized" | tr '[:upper:]' '[:lower:]') # lower case is required in tagging
+ tags+=("$tag")
fi
echo "Tags: ${tags[@]}"