Skip to content

The driver-opts of env.http_proxy can not work. #1241

Open
@seepine

Description

Contributing guidelines

I've found a bug, and:

  • The documentation does not mention anything about my problem
  • There are no open or closed issues that are related to my problem

Description

The Dockerfile

FROM nginx:1.25-alpine-slim

COPY ./dist /html
RUN chmod -R 755 /html

Expected behaviour

It can build success

Actual behaviour

cannot build

Repository URL

No response

Workflow run URL

No response

YAML workflow

name: CI

on:
  push:
    tags:
      - v*

jobs:
  build-image:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 1

      - name: Set up QEMU
        uses: docker/setup-qemu-action@v3

      - name: Set up Docker BuildX
        uses: docker/setup-buildx-action@v3
        with:
            driver-opts: |
              env.http_proxy=${{ env.http_proxy }}
              env.https_proxy=${{ env.http_proxy }}
              "env.no_proxy='${{ env.no_proxy}}'"

      - name: Login to DockerHub
        uses: docker/login-action@v3
        with:
          registry: ${{ env.DOCKER_REGISTRY }}
          username: ${{ env.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}

      - name: Build and push
        uses: docker/build-push-action@v4
        with:
          context: .
          file: ./Dockerfile
          platforms: |
            linux/amd64
            linux/arm64            
          push: true
          tags: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_USERNAME }}/front-app:latest
          build-args: |
            "http_proxy=${{ env.http_proxy }}"
            "https_proxy=${{ env.http_proxy }}"

Workflow logs

[command]/usr/bin/docker buildx build --build-arg http_proxy=http://192.168.3.29:7890 --build-arg https_proxy=http://192.168.3.29:7890 --file ./Dockerfile --iidfile /tmp/docker-actions-toolkit-eCr2D4/build-iidfile-d1d8cd309c.txt --platform linux/amd64,linux/arm64 --attest type=provenance,mode=max,builder-id=https://git.example/user/front-app/actions/runs/12435/attempts/1 --tag git.example/user/front-app:latest --metadata-file /tmp/docker-actions-toolkit-eCr2D4/build-metadata-758931957d.json .
#0 building with "builder-66fcddf6-c62c-4a34-8816-a78edd01421b" instance using docker-container driver
#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 515B done
#1 DONE 0.0s
#2 [linux/amd64 internal] load metadata for docker.io/library/nginx:1.25-alpine-slim
#2 ERROR: failed to do request: Head "https://registry-1.docker.io/v2/library/nginx/manifests/1.25-alpine-slim": EOF
#3 [linux/arm64 internal] load metadata for docker.io/library/nginx:1.25-alpine-slim
#3 CANCELED
------
 > [linux/amd64 internal] load metadata for docker.io/library/nginx:1.25-alpine-slim:
------
WARNING: No output specified with docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
Dockerfile:2
--------------------
   1 | >>> FROM nginx:1.25-alpine-slim
   2 | 
   3 |     RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories \
--------------------
ERROR: failed to solve: nginx:1.25-alpine-slim: failed to resolve source metadata for docker.io/library/nginx:1.25-alpine-slim: failed to do request: Head "https://registry-1.docker.io/v2/library/nginx/manifests/1.25-alpine-slim": EOF
::group::Reference
builder-66fcddf6-c62c-4a34-8816-a78edd01421b/builder-66fcddf6-c62c-4a34-8816-a78edd01421b0/sxjvzrt3xvzjy9ijkrpav6wtl
::endgroup::
::group::Check build summary support
Build summary is not yet supported on GHES
::endgroup::
::error::buildx failed with: ERROR: failed to solve: nginx:1.25-alpine-slim: failed to resolve source metadata for docker.io/library/nginx:1.25-alpine-slim: failed to do request: Head "https://registry-1.docker.io/v2/library/nginx/manifests/1.25-alpine-slim": EOF

BuildKit logs

No response

Additional info

No response

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions