How can my Forgejo runner access volumes from a Docker-in-Docker setup?

0
32
Asked By CuriousCoder95 On

I'm working with a Docker Compose setup that includes Forgejo, Docker-in-Docker (dind), and a Forgejo runner. In my YAML actions, I'm using a Docker command to build an artifact that's located in /repository, which I have mapped to /dind/repository via the volume flag (-v /dind/repository:/repository). After the build, the artifact ends up in /dind/repository within the dind image. My problem is figuring out how to get my runner to access this volume. I've tried mapping /dind/repository to a host directory (/host/dind/repository) and then mapping that to /runner/repository, but subsequent actions are unable to find anything in /runner/repository. It feels like I'm missing something in the workflow!

2 Answers

Answered By DevDynamo83 On

It sounds like you're encountering some common volume binding issues. One thing to consider is that when you set up-volumes, you might accidentally overwrite what's already there. Instead of trying to map everything to the runner, think about storing your artifacts in Forgejo after the build process. Depending on the type of artifact—like if it's an image, use a registry; for binaries or executables, you might want to store them in object storage or directly in Forgejo. This approach could make it easier to manage and retrieve your builds later.

Answered By QuickThinker17 On

Yeah, I had the same issue before! Just moving stuff around in directories can get tricky. If you're dealing with persistent storage, make sure the mappings are correct. Also, don't forget that the artifact type might influence the best storage method—maybe storing it directly in Forgejo could save you some headaches.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.