ansible-container icon indicating copy to clipboard operation
ansible-container copied to clipboard

import from Dockerfile does not support ADD with wildcards

Open dchsueh opened this issue 7 years ago • 1 comments

ISSUE TYPE
  • Bug Report
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'

dchsueh avatar Dec 14 '17 15:12 dchsueh

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

j00bar avatar Jan 25 '18 12:01 j00bar