Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

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 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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events