The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

pipelines - dockerception - possible to run docker inside docker-compose?

Jonas De Beukelaer
March 25, 2019

Hey!

Probably a niche use-case, but we're building a service which uses a go docker client in order to check the existence of images in a private registry. Naturally, this needs a docker daemon to be able to run properly. It is currently being tested in Pipelines using docker-compose.

I've tried mounting the docker socket, to be able to use the parent docker daemon (correct me if I'm missing something) using:

volumes:
- "/var/run/docker.sock:/var/run/docker.sock"

in my docker-compose.yml file.

This runs fine locally but gives me permission denied when run in Pipelines. I understand there are constraints around running docker in privileged, mode for security reasons. Does this explicitly include this mounting? Is there anyway around it?

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Jeroen De Raedt
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 26, 2019
Jonas De Beukelaer
March 27, 2019

Ah this was the document I was looking for to check. Looks like I definitely can't use mounting then.

I've figured out a way around this anyway, using the docker HTTP v2 API allows me to check for images without needed the docker daemon.

soroush.kazemi
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 23, 2020

Hi @Jonas De Beukelaer 

Can you explain the way you fixed the issue?

Jonas De Beukelaer
July 24, 2020

@soroush.kazemi since I only needed to check for image existence, I was able to use this API (golang version specifically) https://docs.docker.com/registry/spec/api/ to simply connect to the repo and check the image exists

TAGS
AUG Leaders

Atlassian Community Events