Open saitejamc opened 7 years ago
@saitejamc
Thank you for trying Ansible Container, and for taking the time to open an issue. We appreciate your feedback!
It appears you may have SELinux enabled. I see it listed in the security options. It may be that we need to add the 'Z' permission to docker/engine.py, where we mount /var/run/docker.sock
into the conductor.
I'll experiment with that today, and see if I can reproduce what you're seeing. In the meantime, you might try temporarily removing the selinux
option from the Docker daemon options, and disabling SELinux on your system, just to see if it makes the problem go away. Not a permanent fix, of course. It would just tell us if that's the culprit.
@chouseknecht You just hit the nail on the head!
I disabled selinux on the machine and ran the ansible-container build command and it worked!!
@saitejamc
I've tried reproducing this with Fedora 25, using vagrant. With the latest docker (docker-ce), selinux enabled in the OS, and on the Docker daemon, it doesn't break.
I am, however, having difficulty getting docker 1.12.6 to install. For some reason cryptography
fails with a gcc
related error.
Will try again with Centos.
@ryansb, please attempt to reproduce this. I failed trying on Fedora 25. I think this just needs a good set of sysadmin eyes.
+1. Error goes away with selinux disabled.
Here's my env:
(.venv) [wrefvem@localhost django-template]$ docker --version
Docker version 1.12.6, build ae7d637/1.12.6
(.venv) [wrefvem@localhost django-template]$ cat /etc/fedora-release
Fedora release 25 (Twenty Five)
EDIT: I get the same error running ansible-container run
with ansible.django-template
.
EDIT2: debug output:
2017-05-03T15:27:35.511649 Verifying service image
[container.docker.engine]
caller_file=/_ansible/container/docker/engine.py
caller_func=containers_built_for_services
caller_line=420
service=u'nginx'
So it's happening during verification of the nginx image.
ISSUE TYPE
container.yml
main.yml
OS / ENVIRONMENT
SUMMARY
While trying to build an image from
ansbile-container build
command, the build fails saying there is an error "docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', error(13, 'Permission denied'))"I also changes the permission of /var/run/docker.sock to 0777 also and tried but no luck.
STEPS TO REPRODUCE