curl-impersonate: A special build of curl that can impersonate Chrome & Firefox
Use local Docker registry in GitHub Action
lwthiker867f23fb58f3
diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.ymlindex 1fd0d9b..8b13b0a 100644--- a/.github/workflows/build-and-test.yml+++ b/.github/workflows/build-and-test.yml@@ -9,36 +9,48 @@ jobs:build-and-test:name: Build curl-impersonate and run the testsruns-on: ubuntu-latest+ services:+ # A local registry is needed to push the build images to because we use+ # the 'docker-container' driver. See+ # https://github.com/docker/buildx/issues/301+ # and+ # See https://github.com/docker/build-push-action/blob/master/docs/advanced/local-registry.md+ registry:+ image: registry:2+ ports:+ - 5000:5000steps:- name: Check out the repouses: actions/checkout@v2- name: Set up Docker Buildxuses: docker/setup-buildx-action@v1+ with:+ driver-opts: network=host- name: Build the Chrome version of curl-impersonateuses: docker/build-push-action@v2with:- push: false- load: true+ push: truecontext: chrome/- tags: curl-impersonate-chrome:latest+ tags: localhost:5000/curl-impersonate/chrome- name: Build the Firefox version of curl-impersonateuses: docker/build-push-action@v2with:- push: false- load: true+ push: truecontext: firefox/- tags: curl-impersonate-firefox:latest+ tags: localhost:5000/curl-impersonate/ff- name: Build the tests containeruses: docker/build-push-action@v2with:- push: falseload: truecontext: tests/tags: curl-impersonate-tests:latest+ build-args: |+ FIREFOX_IMAGE=localhost:5000/curl-impersonate/ff+ CHROME_IMAGE=localhost:5000/curl-impersonate/chrome- name: Run the testsrun: docker run --rm curl-impersonate-tests --log-cli-level DEBUGdiff --git a/tests/Dockerfile b/tests/Dockerfileindex 741d0b5..28d5595 100644--- a/tests/Dockerfile+++ b/tests/Dockerfile@@ -1,3 +1,9 @@+ARG FIREFOX_IMAGE=curl-impersonate-ff+ARG CHROME_IMAGE=curl-impersonate-chrome++FROM ${FIREFOX_IMAGE} as ff+FROM ${CHROME_IMAGE} as chrome+FROM python:3.10.1-slim-busterWORKDIR /tests@@ -13,8 +19,8 @@ RUN pip install --upgrade pip && \RUN mkdir /tests/firefox /tests/chrome# Copy the built binaries from both containers-COPY --from=curl-impersonate-ff /build/out/* /tests/firefox/-COPY --from=curl-impersonate-chrome /build/out/* /tests/chrome/+COPY --from=ff /build/out/* /tests/firefox/+COPY --from=chrome /build/out/* /tests/chrome/COPY . .