Mounting Volumes when using Docker module in Ansible

Here is a snippet from my Ansible playbook …

My problem is that I can not get the host and container to mount. The specific line is:
– /home/vagrant/programs/Jenkins:/var/jenkins_home:rw

  • Updating docker-compose Ubuntu 15.10
  • Remote Node.js typescript debugging in WebStorm
  • How to move docker containers using device mapper to another machine without using docker commands
  • I need to run my node app using this Docker file
  • Xdebug remote.host IP changed when VPN Is active
  • Dockerized PHP Application Architecture Best Practices
  • If I simply change the line to the below the container starts fine, but there is no mount to the host
    – /home/vagrant/programs/Jenkins

    I am also not sure how I can find any logging to trace is there is a permissions issue or something like that.

    Using Ansible 2.2.0.0 and Docker 1.12.3 on Ubuntu Trusty.

    - name: docker and jenkins
      docker:
        name: jenkins
        image: jenkins
        state:  started
        ports:
        - "8080:8080"
        - "50000:50000"
        volumes:
       **- /home/vagrant/programs/jenkins:/var/jenkins_home:rw**
    

    Thanks

    Alistair

  • Docker pulling windows image - failed to register layer: re-exec error: exit status 1
  • Get docker run command for container
  • docker PHP-APACHE "You don't have permission to access / on this server”
  • Choose available memory for containers in Rancher
  • Pass --net=host to docker build
  • AWS ECR Authentication Test
  • One Solution collect form web for “Mounting Volumes when using Docker module in Ansible”

    I think it has something to do with your host permissions. Have you tried executing as root, or using become in playbook?

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.