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:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- name: Authenticate to Gitea registry
|
- name: run buildctl built and push
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
|
||||||
|
# create docker config temp folder
|
||||||
DOCKER_CONFIG_DIR="${RUNNER_TEMP}/.buildctl_docker"
|
DOCKER_CONFIG_DIR="${RUNNER_TEMP}/.buildctl_docker"
|
||||||
mkdir -p "$DOCKER_CONFIG_DIR"
|
mkdir -p "$DOCKER_CONFIG_DIR"
|
||||||
|
|
||||||
# clean up
|
# clean up
|
||||||
trap 'rm -rf "$DOCKER_CONFIG_DIR"' EXIT
|
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
|
cat > "$DOCKER_CONFIG_DIR/config.json" <<EOF
|
||||||
{
|
{
|
||||||
"auths": {
|
"auths": {
|
||||||
@@ -50,29 +52,7 @@ runs:
|
|||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
echo "Checking config.json (safe output):"
|
# Run BuildKit build, set DOCKER_CONFIG to DOCKER_CONFIG_DIR so auth works on push
|
||||||
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
|
|
||||||
DOCKER_CONFIG=$DOCKER_CONFIG_DIR buildctl \
|
DOCKER_CONFIG=$DOCKER_CONFIG_DIR buildctl \
|
||||||
--addr ${{ inputs.buildkit_addr }} \
|
--addr ${{ inputs.buildkit_addr }} \
|
||||||
build \
|
build \
|
||||||
|
|||||||
Reference in New Issue
Block a user