0

I'm struggling to find a solution for the above problem using cloud build yaml.

I need to use a corporate proxy during build phase. If I understand cloud build correctly, the step is pulling an image from internal repository and using it to run docker commands (and so to build the required image).

steps:
- name: 'gcr.io/cloud-builders/docker'
  env:
    - 'HTTP_PROXY=http://xxx.xxx.xxx.xxx:xxxx'
    - 'HTTP_PROXY=http://xxx.xxx.xxx.xxx:xxxx'
  args:
      ['-t', '${_IMAGE}', '.']

I cannot understand how to configure the proxy. The official documentation suggest to edit the dropin file (https://docs.docker.com/config/daemon/systemd/#httphttps-proxy) but I can't understand how to do so, given that the 'gcr.io/cloud-builders/docker' is already a container and it's not running systemd. Things i tried without success:

  • configure the ~/.docker/config.json
  • configure the env vars HTTP_PROXY, HTTPS_PROXY
  • pass --build-arg HTTP_PROXY="http://xxx.xxx.xxx.xxx:xxxx" --build-arg HTTPS_PROXY="http://xxx.xxx.xxx.xxx:xxxx" to the build command

0 Answers0