Skip to content

Latest commit

 

History

History
58 lines (48 loc) · 1.1 KB

docker.md

File metadata and controls

58 lines (48 loc) · 1.1 KB

Testing docker inside docker with molecule

Adding to molecule/default/molecule.yml

Add volume to use docker:

- "/var/run/docker.sock:/var/run/docker.sock"

platforms:
  - name: ansible_test-01
    image: solita/ubuntu-systemd:16.04
    privileged: True
    command: /sbin/init
    capabilities:
      - SYS_ADMIN    
    volumes:
      - "/sys/fs/cgroup:/sys/fs/cgroup:ro"
      - "/var/run/docker.sock:/var/run/docker.sock"
    groups:
      - group1

Add dependency example to install docker in the container

dependency:
  name: galaxy
  options:
    ignore-certs: True
    ignore-errors: True
    role-file: tests/requirements.yml

Example tests/requirements.yml

---
- src: geerlingguy.docker
  name: geerlingguy.docker

Adding to molecule/default/playbook.yml

---
- name: Converge
  hosts: all
  vars:
    burp_module_test_client: False
    burpui_standalone: True
  roles:
    - role: geerlingguy.docker
    - role: ansible-role-docker-nginx