Anyone using ansible-container to build docker images?
If so, maybe someone could help me with this error as the only meaningful result I can find on Google is a stackoverflow post where someone with this exact issue asks how to fix it but didn't get a response other than "hey me too".
I'm just trying to build a simple container from a role that contains a single task: install httpd via yum
Every time I try to build my container I get this error, which seems to be complaining about the lack of a Dockerfile (isn't that.. the whole point?)
$ ansible-container build
Building Docker Engine context...
Starting Docker build of Ansible Container Conductor image (please be patient)...
Parsing conductor CLI args.
Docker™ daemon integration engine loaded. Build starting. project=http-server
Building service... project=http-server service=web
PLAY [web] *********************************************************************
TASK [Gathering Facts] *********************************************************
ok: [web]
TASK [httpd : Install HTTPD] ***************************************************
changed: [web]
PLAY RECAP *********************************************************************
web : ok=2 changed=1 unreachable=0 failed=0
Applied role to service role=httpd service=web
Traceback (most recent call last):
File "/usr/bin/conductor", line 11, in <module>
load_entry_point('ansible-container', 'console_scripts', 'conductor')()
File "/_ansible/container/__init__.py", line 19, in __wrapped__
return fn(*args, **kwargs)
File "/_ansible/container/cli.py", line 399, in conductor_commandline
**params)
File "/_ansible/container/__init__.py", line 19, in __wrapped__
return fn(*args, **kwargs)
File "/_ansible/container/core.py", line 827, in conductorcmd_build
with_name=is_last_role)
File "/_ansible/container/docker/engine.py", line 105, in __wrapped__
return fn(self, *args, **kwargs)
File "/_ansible/container/__init__.py", line 19, in __wrapped__
return fn(*args, **kwargs)
File "/_ansible/container/docker/engine.py", line 682, in commit_role_as_layer
return to_commit.commit(**commit_data).id
File "/usr/lib/python2.7/site-packages/docker/models/containers.py", line 111, in commit
**kwargs)
File "/usr/lib/python2.7/site-packages/docker/utils/decorators.py", line 19, in wrapped
return f(self, resource_id, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/docker/api/container.py", line 131, in commit
json=True)
File "/usr/lib/python2.7/site-packages/docker/api/client.py", line 226, in _result
self._raise_for_status(response)
File "/usr/lib/python2.7/site-packages/docker/api/client.py", line 222, in _raise_for_status
raise create_api_error_from_http_exception(e)
File "/usr/lib/python2.7/site-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
raise cls(e, response=response, explanation=explanation)
docker.errors.APIError: 400 Client Error: Bad Request ("file with no instructions.")
Conductor terminated. Cleaning up. command_rc=1 conductor_id=72f8ed1066757eb0fd8ad08a11cc1389a8ea43b20acefb4ae8b909b4f38ff3f5 save_container=False
ERROR Conductor exited with status 1
Posted Jul 16, 2020, 5:56 AM UTC · edited
I thought it was cool at first but found it wasn’t really worth the effort.