Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using docker hooks in self-hosted container breaks trivy action behind corporate proxy #120

Open
dnewhook opened this issue Nov 24, 2023 · 1 comment
Labels
bug Something isn't working docker

Comments

@dnewhook
Copy link

Hi, coming back to this topic as I wanted to use a bespoke DOCKER_HOST socket in my self-hosted runner. It seems like the default code hard codes /var/run/docker.sock and I wanted to try and change that behaviour. I played with this a while back in #39.

image

My env file is as follows....

XDG_RUNTIME_DIR=/tmp/podman-run-1001
DOCKER_HOST=unix:///tmp/podman-run-1001/podman/podman.sock
ACTIONS_RUNNER_CONTAINER_HOOKS=/home/runner/docker/index.js

A first observation is that using the index.js from this repo seems to change the workflow order. The dockerfile action is not built beforehand - is this expected behaviour?

Without the docker container hooks (default):
image

Using index.js from this repo (0.5.0)....
image

The main issue is that the introduction of the container hooks seems to wipe out the forward proxy settings that are configured for the container. I could put these values in the runner env file but I prefer to pass them dynamically via override values to the helm gha-runner-scale-set:

  set {
    name  = "template.spec.containers[0].env[0].name"
    value = "HTTPS_PROXY"
  }

  set {
    name  = "template.spec.containers[0].env[0].value"
    value = "http://squid-service.${var.forwardproxy_namespace}:3128"
  }

  set {
    name  = "template.spec.containers[0].env[1].name"
    value = "HTTP_PROXY"
  }

  set {
    name  = "template.spec.containers[0].env[1].value"
    value = "http://squid-service.${var.forwardproxy_namespace}:3128"
  }

Any suggestions welcome thankyou!

@nikola-jokic
Copy link
Contributor

Hey @dnewhook,

It seems to me that only the environment variables that are related to the docker itself are exposed, which is a problem.

Thank you for reporting it!

@nikola-jokic nikola-jokic added bug Something isn't working docker labels Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working docker
Projects
None yet
Development

No branches or pull requests

2 participants