ansible / ansible-container

DEPRECATED -- Ansible Container was a tool to build Docker images and orchestrate containers using only Ansible playbooks.
GNU Lesser General Public License v3.0
2.19k stars 392 forks source link

import from Dockerfile does not support ADD with wildcards #834

Open dchsueh opened 6 years ago

dchsueh commented 6 years ago
ISSUE TYPE
container.yml

not applicable

OS / ENVIRONMENT
$ ansible-container --debug version
Ansible Container, version 0.9.3rc0
Linux, ubuntu, 4.4.0-101-generic, #124-Ubuntu SMP Fri Nov 10 18:29:59 UTC 2017, x86_64
2.7.12 (default, Nov 20 2017, 18:23:56) 
[GCC 5.4.0 20160609] /home/ubuntu/ansible-container/bin/python2

using virtualenv, ansible-container installed from github repo checkout from 2017-12-13 also confirmed with current pip-installed ansible-container version (0.9.2?)

SUMMARY

ansible-container import does not support import of Dockerfile with ADD statements that use wildcards. Workaround: use COPY

STEPS TO REPRODUCE

Use any Dockerfile with ADD command that uses * wildcard, e.g.

FROM centos:7
...
ADD *.repo /etc/yum.repos.d/
...

Then attempt ansible-container import .

EXPECTED RESULTS

Expect import to succeed.

ACTUAL RESULTS
ERROR   Unknown exception   
Traceback (most recent call last):
...
...
IOError: [Errno 2] No such file or directory: u'<path-to-docker-context-dir>/*.repo'
j00bar commented 6 years ago

This is doable with the with_fileglob loop structure in Ansible. I'll work on this. Thanks!