# Mount volume in 'image:docker' pipeline step

**URL:** <https://drone.discourse.group/t/mount-volume-in-image-docker-pipeline-step/9990>\
**Category:** Drone Support\
**Created:** [November 17, 2017, 8:42am UTC](https://drone.discourse.group/t/mount-volume-in-image-docker-pipeline-step/9990 "2017-11-17T08:42:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sudmota](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/sudmota/32/5208_2.png) [@Sudmota](https://drone.discourse.group/u/Sudmota)\
**Post date:** [November 17, 2017, 8:42am UTC](https://drone.discourse.group/t/mount-volume-in-image-docker-pipeline-step/9990/1 "2017-11-17T08:42:27Z")

</div>

Hello !

I have a pipeline which consists mostly in:

1. build image A & push to registry (working)
2. build image B & push to registry (working)
3. read a file from git and do a eyaml decrypt \<----- (not working)
4. deploy image that is now in registry, in kubernetes, with the decrypted file (not yet implemented)

Regarding step 3. , i cannot get this to work. This is the step description:

```auto
  deploy-decrypt-secrets-dev:
    image: docker
    secrets: [pkcs7_private_key, pkcs7_public_key]
    commands:
      - mkdir -p /drone/eyaml-keys
      - echo $PKCS7_PRIVATE_KEY > /drone/eyaml-keys/private_key.pkcs7.pem
      - echo $PKCS7_PUBLIC_KEY > /drone/eyaml-keys/public_key.pkcs7.pem
      - ls -sal /drone/eyaml-keys
      - docker run --rm --entrypoint='ls' -v '/drone:/drone:ro' --name eyaml halberom/hiera-eyaml /drone
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    when:
      event: push

```

`ls -sal` returns the expected result:

```auto
total 16
     4 drwxr-xr-x 2 root root 4096 Nov 17 08:29 .
     4 drwxr-xr-x 4 root root 4096 Nov 17 08:29 ..
     4 -rw-r--r-- 1 root root 1675 Nov 17 08:29 private_key.pkcs7.pem
     4 -rw-r--r-- 1 root root 1050 Nov 17 08:29 public_key.pkcs7.pem

```

however, the `docker run` command returns only (which ultimately is doing a `ls /drone`):

```auto
src

```

Locally, i’m able to have this working locally (ie return not only `src` but also the two keys, but somehow [drone.ci](http://drone.ci) dislikes it. Is there any workaround ?

Thank you for your time/help !

---

<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:** [November 17, 2017, 3:36pm UTC](https://drone.discourse.group/t/mount-volume-in-image-docker-pipeline-step/9990/2 "2017-11-17T15:36:52Z")

</div>

> [@Integration Guide - Azure DevOps (TFS)](https://drone.discourse.group/t/integration-guide-azure-devops-tfs/1088/1):
>
> -v ‘/drone:/drone:ro’

The reason this does not work is because you are connecting to the **host** machine docker daemon. The path `/drone` that you are trying to mount does not exist on the host machine, because it is a container volume and only exists at `/drone` inside the container.
