Skip to content

Commit

Permalink
ci: proxy config check
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max committed Jun 5, 2023
1 parent f9efed5 commit b0db9b1
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -1001,3 +1001,39 @@ jobs:
file: ./test/named-context.Dockerfile
build-contexts: |
alpine=docker-image://localhost:5000/my-base-image:latest
proxy-docker-config:
runs-on: ubuntu-latest
services:
squid-proxy:
image: ubuntu/squid:latest
ports:
- 3128:3128
steps:
-
name: Check proxy
run: |
netstat -aptn
curl --retry 5 --retry-all-errors --retry-delay 0 --connect-timeout 5 --proxy http://127.0.0.1:3128 -v --insecure --head https://www.google.com
-
name: Checkout
uses: actions/checkout@v3
-
name: Set proxy config
run: |
mkdir -p ~/.docker
echo '{"proxies":{"default":{"httpProxy":"http://127.0.0.1:3128","httpsProxy":"http://127.0.0.1:3128"}}}' > ~/.docker/config.json
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: |
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
network=host
buildkitd-flags: --debug
-
name: Build
uses: ./
with:
context: ./test
file: ./test/proxy.Dockerfile
9 changes: 9 additions & 0 deletions test/proxy.Dockerfile
@@ -0,0 +1,9 @@
# syntax=docker/dockerfile:1
FROM alpine
RUN apk add --no-cache curl net-tools
ARG HTTP_PROXY
ARG HTTPS_PROXY
RUN printenv HTTP_PROXY
RUN printenv HTTPS_PROXY
RUN netstat -aptn
RUN curl --retry 5 --retry-all-errors --retry-delay 0 --connect-timeout 5 --proxy $HTTP_PROXY -v --insecure --head https://www.google.com

0 comments on commit b0db9b1

Please sign in to comment.