Build docker image in self-hosted runner

Hi,

I have a self-hosted runner hosted in EKS. All is well, except I can’t get it to build a docker image. It needs to happen in EKS because the image includes an internally hosted private python package. The base image is cimg/aws:2024.03.1. I have tried:

  • adding the circleci user to the docker group
  • doing the above and then relogging in with su - circleci
  • changing the permissions on /var/run/docker.sock to 777
  • using sudo for everything

Amongst the errors I’ve encountered are

  • permission denied on the socket
  • can’t connect to the socket

and currently, failing after a 30 min timeout without any feedback in the logs.

Any insight you can provide will be most helpful. Thx!

I will kindly recommend you steer away from trying to build Docker images from within a container. You’re going to have a bad time.

If I had services/registries/packages being hosted on EKS that I needed in order to build my Docker images, then I would probably be spinning up an EC2 instance behind the same VPC and have that instance serve as my runner. That would be much simpler.

1 Like

Container runner reference - CircleCI let me know if this doesn’t get you what you’re looking for