mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-21 03:46:37 +00:00
fix: resolve Docker workflow manual build parameter issues (#236)
- Remove unsupported 'scopes' parameter from docker/login-action@v3
* Fixes 'Unexpected input(s) scopes' error during Docker Hub login
- Add version format conversion for Dockerfile compatibility
* main-latest/dev-latest → RELEASE=latest + CHANNEL=dev
* latest → RELEASE=latest + CHANNEL=release
* dev-* → RELEASE=dev-* + CHANNEL=dev
* v* → RELEASE={version without v} + CHANNEL=release
- Fix Docker build parameter passing
* Use converted docker_release and docker_channel values
* Ensures correct binary download URLs in Dockerfile
Resolves manual Docker build failures reported in:
https://github.com/rustfs/rustfs/actions/runs/16330398463/job/46131302262
This commit is contained in:
@@ -227,7 +227,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
username: ${{ env.DOCKERHUB_USERNAME }}
|
username: ${{ env.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
scopes: repository:rustfs/rustfs:pull,push
|
|
||||||
|
|
||||||
# - name: Login to GitHub Container Registry
|
# - name: Login to GitHub Container Registry
|
||||||
# uses: docker/login-action@v3
|
# uses: docker/login-action@v3
|
||||||
@@ -250,6 +249,43 @@ jobs:
|
|||||||
SHORT_SHA="${{ needs.build-check.outputs.short_sha }}"
|
SHORT_SHA="${{ needs.build-check.outputs.short_sha }}"
|
||||||
CREATE_LATEST="${{ needs.build-check.outputs.create_latest }}"
|
CREATE_LATEST="${{ needs.build-check.outputs.create_latest }}"
|
||||||
|
|
||||||
|
# Convert version format for Dockerfile compatibility
|
||||||
|
case "$VERSION" in
|
||||||
|
"main-latest"|"dev-latest")
|
||||||
|
# For latest builds, use RELEASE=latest + appropriate CHANNEL
|
||||||
|
DOCKER_RELEASE="latest"
|
||||||
|
DOCKER_CHANNEL="dev"
|
||||||
|
;;
|
||||||
|
"latest")
|
||||||
|
# For stable latest, use RELEASE=latest + release CHANNEL
|
||||||
|
DOCKER_RELEASE="latest"
|
||||||
|
DOCKER_CHANNEL="release"
|
||||||
|
;;
|
||||||
|
dev-*)
|
||||||
|
# For development builds (dev-abc123), pass as-is without 'v' prefix
|
||||||
|
DOCKER_RELEASE="${VERSION}"
|
||||||
|
DOCKER_CHANNEL="dev"
|
||||||
|
;;
|
||||||
|
v*)
|
||||||
|
# For versioned releases (v1.0.0), remove 'v' prefix for Dockerfile
|
||||||
|
DOCKER_RELEASE="${VERSION#v}"
|
||||||
|
DOCKER_CHANNEL="release"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
# For custom versions, pass as-is
|
||||||
|
DOCKER_RELEASE="${VERSION}"
|
||||||
|
DOCKER_CHANNEL="release"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
echo "docker_release=$DOCKER_RELEASE" >> $GITHUB_OUTPUT
|
||||||
|
echo "docker_channel=$DOCKER_CHANNEL" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
echo "🐳 Docker build parameters:"
|
||||||
|
echo " - Original version: $VERSION"
|
||||||
|
echo " - Docker RELEASE: $DOCKER_RELEASE"
|
||||||
|
echo " - Docker CHANNEL: $DOCKER_CHANNEL"
|
||||||
|
|
||||||
# Generate tags based on build type
|
# Generate tags based on build type
|
||||||
TAGS=""
|
TAGS=""
|
||||||
|
|
||||||
@@ -318,7 +354,8 @@ jobs:
|
|||||||
VERSION=${{ needs.build-check.outputs.version }}
|
VERSION=${{ needs.build-check.outputs.version }}
|
||||||
BUILD_TYPE=${{ needs.build-check.outputs.build_type }}
|
BUILD_TYPE=${{ needs.build-check.outputs.build_type }}
|
||||||
REVISION=${{ github.sha }}
|
REVISION=${{ github.sha }}
|
||||||
RELEASE=${{ needs.build-check.outputs.version }}
|
RELEASE=${{ steps.meta.outputs.docker_release }}
|
||||||
|
CHANNEL=${{ steps.meta.outputs.docker_channel }}
|
||||||
BUILDKIT_INLINE_CACHE=1
|
BUILDKIT_INLINE_CACHE=1
|
||||||
# Enable advanced BuildKit features for better performance
|
# Enable advanced BuildKit features for better performance
|
||||||
provenance: false
|
provenance: false
|
||||||
|
|||||||
Reference in New Issue
Block a user