# Ansible-runner inside Docker

**URL:** <https://forum.ansible.com/t/ansible-runner-inside-docker/40206>\
**Category:** Get Help\
**Tags:** ansible-runner, ee\
**Created:** [February 12, 2025, 8:46am UTC](https://forum.ansible.com/t/ansible-runner-inside-docker/40206 "2025-02-12T08:46:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamroddo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/iamroddo/32/321_2.png) [@iamroddo](https://forum.ansible.com/u/iamroddo)\
**Post date:** [February 12, 2025, 8:46am UTC](https://forum.ansible.com/t/ansible-runner-inside-docker/40206/1 "2025-02-12T08:46:12Z")

</div>

I am exploring the use of ansible-runner. I have been able to get it to run on the CLI on my Mac in my host with `env/settings` as below …

```yaml
container_image: ee-29-rhel8
process_isolation_executable: docker
process_isolation: true
container_volume_mounts:
- /Users/rod/Documents/Development/ansible-repo:/workspaces/ansible-repo
container_options:
- '--platform=linux/amd64'
debug: true

```

… and executing `ansible-runner run /Users/rod/Documents/Development/ansible-repo/ansible-runner -p /workspaces/ansible-repo/experiment.yml`

However when I try running `ansible-runner` in a Docker container spun up VS Code Devcontainer I get the following error …

```auto
root@309828da25ff:/workspaces/ansible-repo# ansible-runner run ansible-runner/ -p experiment.yml
docker: Error response from daemon: Mounts denied:
The path /workspaces/ansible-repo/ansible-runner is not shared from the host and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing.
See https://docs.docker.com/desktop/settings/mac/#file-sharing for more info.
root@309828da25ff:/workspaces/ansible-repo#

```

The command `docker run -it --platform=linux/amd64 --rm -v /Users/rod/Documents/Development/ansible-repo:/workspaces/ansible-repo ee-29-rhel8 bash` executes just fine from within the Devcontainer Docker container.

However the path mentioned in this error cannot be configured in Docker Desktop as the path `/workspaces/ansible-repo/ansible-runner` is only known in the container and not on the host.

When I execute `ansible-runner run ansible-runner -p ansible-runner/experiment.yml --debug`, the output contains `command: docker run --rm --tty --interactive --workdir /runner/project -v /workspaces/ansible-repo/ansible-runner/:/runner/:Z --env-file /workspaces/ansible-repo/ansible-runner/artifacts/14b474b7-2692-46ea-879d-82d132e70d54/env.list --user=0 --name ansible_runner_14b474b7-2692-46ea-879d-82d132e70d54 --platform=linux/amd64 ee-29-rhel8 ansible-playbook -i /runner/inventory -e @/runner/env/extravars experiment.yml`.

I think this command would succeed if instead of trying to mount `/workspaces/ansible-repo/ansible-runner/` to `/runner/`, it would mount `/Users/rod/Documents/Development/ansible-repo:/workspaces/ansible-repo/ansible-runner` to `/runner/`.

Any ideas?

---

<div class="post-metadata">

**Author:** ![Andersson007](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/andersson007/32/89_2.png) [@Andersson007](https://forum.ansible.com/u/Andersson007)\
**Post date:** [February 13, 2025, 6:51am UTC](https://forum.ansible.com/t/ansible-runner-inside-docker/40206/2 "2025-02-13T06:51:31Z")

</div>

hello @iamroddo, thanks for posting the question!  
I’ve just put the ansible-runner label, hope people involved will get notified.
