ansible-community / molecule-docker

🚧 Assimilated into molecule-plugins
https://github.com/ansible-community/molecule-plugins
MIT License
77 stars 39 forks source link

Docker image creation fails with molecule #79

Closed lkalina-cera closed 3 years ago

lkalina-cera commented 3 years ago

Issue Type

Molecule and Ansible details

molecule 3.3.0 using python 3.7
    ansible:2.10.8
    delegated:3.3.0 from molecule
    docker:0.2.4 from molecule_docker

Molecule installation method (one of):

pip (in a venv) Ansible installation method (one of):

pip (in a venv)

Desired Behavior

Here is my simple project structure. I would like to use the image for further work.

└── molecule
    └── default
        ├── Dockerfile
        ├── converge.yml
        ├── molecule.yml
        └── test_folder
            └── test_file

Dockerfile content

FROM centos:7

COPY test_folder /test_folder

converge-yml content

---
- name: Converge example
  hosts: localhost
  gather_facts: no

molecule.yml content

---
dependency:
  name: galaxy
driver:
  name: docker
platforms:
  - name: atestimage
    image: test/testimage:0.1
    dockerfile: Dockerfile
    pre_build_image: false
provisioner:
  name: ansible
scenario:
  create_sequence:
    - dependency
    - create
    - destroy

In the command line I use molecule create and then the images should have created.

Actual Behaviour

Image creations fails with the following message

msg": "Error building molecule_local/test/testimage - code: None, message: COPY failed: stat /var/lib/docker/tmp/docker-builder598809966/test_folder: no such file or directory,

Please help me to identify whats the problem whit this.

tadeboro commented 3 years ago

This issue should be solved in the development version of the docker driver. Can you please test this and report back?

See https://github.com/ansible-community/molecule-docker/pull/51 for more details about the implementation details.

lkalina-cera commented 3 years ago

I reinstalled the ansible, and molecule and their dependencies in a virtual env with the following versions


    ansible:2.11.2
    delegated:3.3.4 from molecule
    docker:0.3.4 from molecule_docker```
    now the image creation works fine.

 I am going to close this issue, thanks for your help @tadeboro