modified: .gitea/actions/buildkit-build-push/action.yaml
All checks were successful
/ build-image (push) Successful in 14s
All checks were successful
/ build-image (push) Successful in 14s
This commit is contained in:
@@ -28,18 +28,20 @@ inputs:
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Authenticate to Gitea registry
|
||||
- name: run buildctl built and push
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
# create docker config temp folder
|
||||
DOCKER_CONFIG_DIR="${RUNNER_TEMP}/.buildctl_docker"
|
||||
mkdir -p "$DOCKER_CONFIG_DIR"
|
||||
|
||||
# clean up
|
||||
trap 'rm -rf "$DOCKER_CONFIG_DIR"' EXIT
|
||||
|
||||
AUTH=$(printf "%s" "${{ inputs.registry_username }}:${{ inputs.registry_password }}" | base64 -w 0)
|
||||
|
||||
# setup file docker config (auth) temp file
|
||||
AUTH=$(printf "%s" "${{ inputs.registry_username }}:${{ inputs.registry_password }}" | base64 -w 0)
|
||||
cat > "$DOCKER_CONFIG_DIR/config.json" <<EOF
|
||||
{
|
||||
"auths": {
|
||||
@@ -50,29 +52,7 @@ runs:
|
||||
}
|
||||
EOF
|
||||
|
||||
echo "Checking config.json (safe output):"
|
||||
if [ ! -f "$DOCKER_CONFIG_DIR/config.json" ]; then
|
||||
echo "ERROR: config.json missing"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
jq '
|
||||
.auths |= with_entries(
|
||||
.value.auth = "***MASKED***"
|
||||
)
|
||||
' "$DOCKER_CONFIG_DIR/config.json"
|
||||
|
||||
DECODED_USER=$(printf "%s" "$AUTH" | base64 -d | cut -d: -f1)
|
||||
echo "Registry user: $DECODED_USER"
|
||||
|
||||
#export DOCKER_CONFIG=$DOCKER_CONFIG_DIR
|
||||
|
||||
echo "Testing registry.config visibility inside buildkitd:"
|
||||
buildctl \
|
||||
--addr ${{ inputs.buildkit_addr }} \
|
||||
debug workers
|
||||
|
||||
# Run BuildKit build
|
||||
# Run BuildKit build, set DOCKER_CONFIG to DOCKER_CONFIG_DIR so auth works on push
|
||||
DOCKER_CONFIG=$DOCKER_CONFIG_DIR buildctl \
|
||||
--addr ${{ inputs.buildkit_addr }} \
|
||||
build \
|
||||
|
||||
Reference in New Issue
Block a user