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 ENV NAME=value #835

Closed dchsueh closed 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 ENV statements that use format "NAME=value" Workaround: use "NAME value"

STEPS TO REPRODUCE

Use a Dockerfile with ENV command that uses equals format, e.g.

FROM centos:7
...
...
ENV JAVA_HOME=/usr/java/jdk1.8.0_152/jre/ \
  PATH=/opt/apache-maven-3.5.0/bin:${PATH} \
  M2_HOME=/opt/apache-maven-3.5.0
...

Then attempt ansible-container import .

EXPECTED RESULTS

Expect import to succeed.

ACTUAL RESULTS
ERROR   Unknown exception   
Traceback (most recent call last):
...
...
ValueError: dictionary update sequence element #1 has length 1; 2 is required
j00bar commented 6 years ago

I will attempt to recreate your issue.

In the future, the actual stack trace is far more helpful than ..., particularly when the error is a generic Python error. More output is far more helpful than less.