feature/new-oci-deployment #2

Merged
marcio.fernandes merged 30 commits from feature/new-oci-deployment into main 2026-05-03 01:17:48 +00:00
2 changed files with 27 additions and 43 deletions
Showing only changes of commit 478855ad86 - Show all commits
@@ -38,51 +38,34 @@ runs:
- name: run buildctl build and push - name: run buildctl build and push
shell: bash shell: bash
run: | run: |
############################################### ###############################################
# Create DOCKER_CONFIG for this pipeline # Build args
############################################### ###############################################
DOCKER_CONFIG_DIR="${RUNNER_TEMP}/.buildctl_docker" BUILD_ARG_FLAGS=""
mkdir -p "$DOCKER_CONFIG_DIR" while IFS= read -r line; do
[[ -z "$line" ]] && continue
BUILD_ARG_FLAGS="$BUILD_ARG_FLAGS --opt build-arg:${line}"
done <<< "${{ inputs.build_args }}"
trap 'rm -rf "$DOCKER_CONFIG_DIR"' EXIT echo "Using build args: $BUILD_ARG_FLAGS"
AUTH=$(printf "%s:%s" "${{ inputs.registry_username }}" "${{ inputs.registry_password }}" | base64 -w0) ###############################################
# Inline auth for BuildKit remote push
###############################################
cat > "$DOCKER_CONFIG_DIR/config.json" <<EOF AUTH_INLINE=$(printf "%s:%s" "${{ inputs.registry_username }}" "${{ inputs.registry_password }}" | base64 -w0)
{
"auths": {
"${{ inputs.registry_addr }}": {
"auth": "$AUTH"
}
}
}
EOF
############################################### ###############################################
# Build args # Build + push using BuildKit REMOTE + INLINE AUTH
############################################### ###############################################
BUILD_ARG_FLAGS="" buildctl \
while IFS= read -r line; do --addr ${{ inputs.buildkit_addr }} \
[[ -z "$line" ]] && continue build \
BUILD_ARG_FLAGS="$BUILD_ARG_FLAGS --opt build-arg:${line}" --frontend=dockerfile.v0 \
done <<< "${{ inputs.build_args }}" --local context=${{ inputs.context }} \
--local dockerfile=${{ inputs.dockerfile }} \
echo "Using build args: $BUILD_ARG_FLAGS" --opt filename=${{ inputs.filename }} \
$BUILD_ARG_FLAGS \
############################################### --output type=image,name=${{ inputs.tags }},push=true,registry.auth=$AUTH_INLINE
# Build + push using BuildKit REMOTE + SECRET
###############################################
buildctl \
--addr ${{ inputs.buildkit_addr }} \
build \
--frontend=dockerfile.v0 \
--local context=${{ inputs.context }} \
--local dockerfile=${{ inputs.dockerfile }} \
--opt filename=${{ inputs.filename }} \
$BUILD_ARG_FLAGS \
--secret id=harbor,src=$DOCKER_CONFIG_DIR/config.json \
--opt secret=harbor \
--output type=image,name=${{ inputs.tags }},push=true
@@ -16,6 +16,7 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Fetch limbo public actions - name: Fetch limbo public actions
env: env:
RUNNER_TEMP: "${{ runner.temp }}" RUNNER_TEMP: "${{ runner.temp }}"