# Can I use volumes in Drone Cloud in order to map /var/run/docker.sock?

**URL:** <https://drone.discourse.group/t/can-i-use-volumes-in-drone-cloud-in-order-to-map-var-run-docker-sock/8547>\
**Category:** Drone Support\
**Created:** [April 20, 2021, 5:22pm UTC](https://drone.discourse.group/t/can-i-use-volumes-in-drone-cloud-in-order-to-map-var-run-docker-sock/8547 "2021-04-20T17:22:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![karatach1998](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/karatach1998/32/3312_2.png) [@karatach1998](https://drone.discourse.group/u/karatach1998)\
**Post date:** [April 20, 2021, 5:22pm UTC](https://drone.discourse.group/t/can-i-use-volumes-in-drone-cloud-in-order-to-map-var-run-docker-sock/8547/1 "2021-04-20T17:22:25Z")

</div>

I need to know the docker image id in the registry to include it in the Heroku API request in order to perform a release. To do that I use `docker inspect tag --format={{.Id}}` inside `alpine` image and install `docker-cli` to that. In order docker command to work I need a volume mapping from host `/var/run/docker.sock` to container `/var/run/docker.sock`.

```
steps:
  - name: release
    image: alpine
    volumes:
      - name: dockersock
        path: /var/run/docker.sock
    commands: [...]

volumes:
  - name: dockersock
    host:
      path: /var/run/docker.sock

```

But this causes build error in [cloud.drone.com](http://cloud.drone.com) with the message “default : error”.

What I do wrong? Maybe some alternative solution will be better?

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [April 20, 2021, 10:06pm UTC](https://drone.discourse.group/t/can-i-use-volumes-in-drone-cloud-in-order-to-map-var-run-docker-sock/8547/2 "2021-04-20T22:06:35Z")

</div>

pipeline cannot mount volumes by default, for security reasons. we therefore do not allow volumes to be mounted at drone cloud, however, you always have the option to self-host Drone on your own infrastructure.

---

<div class="post-metadata">

**Author:** ![Kash](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/kash/32/4921_2.png) [@Kash](https://drone.discourse.group/u/Kash)\
**Post date:** [April 21, 2021, 10:11am UTC](https://drone.discourse.group/t/can-i-use-volumes-in-drone-cloud-in-order-to-map-var-run-docker-sock/8547/3 "2021-04-21T10:11:41Z")

</div>

Hi @karatach1998, I had a similar case and worked around it without a volume mount, which I believe is still possible on Drone Cloud. Example below:

```auto
kind: pipeline
type: kubernetes
name: default

steps:
- name: release
  image: docker:dind
  environment:
    DOCKER_HOST: tcp://docker:2375
  commands:
  # wait for docker service to be up before running docker build
  - n=0; while ["$n" -lt 60] && [! docker stats --no-stream]; do n=$(( n + 1 )); sleep 1; done
  - ...

services:
- name: docker
  image: docker:dind
  environment:
    DOCKER_TLS_CERTDIR: ""

```
