modified: .gitea/limbo_actions/buildkit-build-push/action.yaml
/ build-docker-image (push) Successful in 16s
/ build-docker-image (push) Successful in 16s
This commit is contained in:
@@ -38,17 +38,18 @@ runs:
|
|||||||
- name: run buildctl build and push
|
- name: run buildctl build and push
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
# create docker config temp folder
|
DOCKER_CONFIG="${RUNNER_TEMP}/.buildctl_docker"
|
||||||
DOCKER_CONFIG_DIR="${RUNNER_TEMP}/.buildctl_docker"
|
mkdir -p "$DOCKER_CONFIG"
|
||||||
mkdir -p "$DOCKER_CONFIG_DIR"
|
|
||||||
|
|
||||||
# clean up
|
# clean up
|
||||||
trap 'rm -rf "$DOCKER_CONFIG_DIR"' EXIT
|
trap 'rm -rf "$DOCKER_CONFIG"' EXIT
|
||||||
|
|
||||||
|
|
||||||
# setup file docker config (auth) temp file
|
USER='${{ inputs.registry_username }}'
|
||||||
AUTH=$(printf "%s" "${{ inputs.registry_username }}:${{ inputs.registry_password }}" | base64 -w 0)
|
PASS='${{ inputs.registry_password }}'
|
||||||
cat > "$DOCKER_CONFIG_DIR/config.json" <<EOF
|
AUTH=$(printf '%s:%s' "$USER" "$PASS" | base64 -w0)
|
||||||
|
cat > "$DOCKER_CONFIG/config.json" <<EOF
|
||||||
{
|
{
|
||||||
"auths": {
|
"auths": {
|
||||||
"${{ inputs.registry_addr }}": {
|
"${{ inputs.registry_addr }}": {
|
||||||
@@ -67,8 +68,9 @@ runs:
|
|||||||
|
|
||||||
echo "Using build args: $BUILD_ARG_FLAGS"
|
echo "Using build args: $BUILD_ARG_FLAGS"
|
||||||
|
|
||||||
# Run BuildKit build
|
echo "build and push image to ${{ inputs.registry_addr }}"
|
||||||
DOCKER_CONFIG=$DOCKER_CONFIG_DIR buildctl \
|
|
||||||
|
DOCKER_CONFIG="$DOCKER_CONFIG" buildctl \
|
||||||
--addr ${{ inputs.buildkit_addr }} \
|
--addr ${{ inputs.buildkit_addr }} \
|
||||||
build \
|
build \
|
||||||
--frontend=dockerfile.v0 \
|
--frontend=dockerfile.v0 \
|
||||||
@@ -77,5 +79,4 @@ runs:
|
|||||||
--opt filename=${{ inputs.filename }} \
|
--opt filename=${{ inputs.filename }} \
|
||||||
$BUILD_ARG_FLAGS \
|
$BUILD_ARG_FLAGS \
|
||||||
--output type=image,name=${{ inputs.tags }},push=true
|
--output type=image,name=${{ inputs.tags }},push=true
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user