I'm trying to create a pipe for customers that builds software for a niche platform, but I'm running into an issue.
One of the inputs for the pipe is the version of the software they're using. That translates to a Docker image tag that we have hosted on GitHub Container Registry (GHCR.io). So, at runtime, I need the pipe to read the version that the user has requested in the inputs, pull down a Docker image specific to that version, and then run it.
The problem I'm running into is that it seems that BitBucket doesn't allow Docker-in-Docker, so my pipe is unable to pull down or run the image. I've tried mounting /var/run/docker.sock when running my unit tests, I've tried running it as privileged, I've tried the DOCKER_BUILDKIT environment variable (both 1 and 0) and I get errors such as:
"Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?"
"Error response from daemon: authorization denied by plugin pipelines: --privileged=true is not allowed."
"dial unix /var/run/docker.sock: connect: permission denied"
Has anyone built a custom pipe for BitBucket Pipelines that dynamically pulls down Docker images based on inputs to the pipe? What am I missing here?