Skip to content
This repository has been archived by the owner on Mar 23, 2019. It is now read-only.

Issue with building #66

Closed
cdrage opened this issue Jun 17, 2016 · 11 comments
Closed

Issue with building #66

cdrage opened this issue Jun 17, 2016 · 11 comments

Comments

@cdrage
Copy link
Contributor

cdrage commented Jun 17, 2016

▶ cat container.yml 
version: "1"
services:
  web:
   image: nginx
   ports:
     - "80:80"
 - hosts: all
   gather_facts: false
   tasks:
     - raw: which python || apt-get update
     - raw: (which python && which aptitude) || apt-get install -y python python-apt aptitude
 - hosts: web
   tasks:
     - name: Upgrade APT
       apt: upgrade=yes
     - name: Install ca-certificates
       apt: name=ca-certificates state=latest
     - name: Install dumb-init
       apt: deb=https://github.com/Yelp/dumb-init/releases/download/v1.0.2/dumb-init_1.0.2_amd64.deb
     - name: Install Apache
       apt: name=apache2 state=latest

Error:

▶ ansible-container build
(Re)building the Ansible Container image.
Building Docker Engine context...
Starting Docker build of Ansible Container image...
Ansible Container image has ID sha256:f8be78751e9326d50a94cf7d9a2195655baa9d45a9844bb62f1eabcb4611fca1
Starting Docker Compose engine to build your images...
Attaching to ansible_ansible-container_1
Cleaning up Ansible Container builder...
Attaching to ansible_ansible-container_1, ansible_web_1
ansible-container_1  | 
ansible-container_1  | PLAY [all] *********************************************************************
ansible-container_1  | 
ansible-container_1  | TASK [raw] *********************************************************************
ansible-container_1  | Cannot connect to the Docker daemon. Is the docker daemon running on this host?
ansible-container_1  | An exception occurred during task execution. To see the full traceback, use -vvv. The error was: CalledProcessError: Command '['/usr/bin/docker', 'version']' returned non-zero exit status 1
ansible-container_1  | fatal: [web]: FAILED! => {"failed": true, "msg": "Unexpected failure during module execution.", "stdout": ""}
ansible-container_1  | 
ansible-container_1  | NO MORE HOSTS LEFT *************************************************************
ansible-container_1  |  [WARNING]: Could not create retry file 'main.retry'.         Unable to create
ansible-container_1  | local directories(): [Errno 2] No such file or directory: ''
ansible-container_1  | 
ansible-container_1  | PLAY RECAP *********************************************************************
ansible-container_1  | web                        : ok=0    changed=0    unreachable=0    failed=1   
ansible-container_1  | 
ansible_ansible-container_1 exited with code 1
Aborting on container exit...
Stopping ansible_web_1 ... done
Ansible playbook run failed.
Cleaning up Ansible Container builder...

Docker version:

~/test/ansible                                                                                                                                                                                                                                                
▶ docker version
Client:
 Version:      1.11.2
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   b9f10c9
 Built:        Wed Jun  1 21:20:08 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.11.2
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   b9f10c9
 Built:        Wed Jun  1 21:20:08 2016
 OS/Arch:      linux/amd64
@bkero
Copy link

bkero commented Jun 21, 2016

This is affecting me as well.

@j00bar
Copy link
Contributor

j00bar commented Jun 21, 2016

echo $DOCKER_HOST plz.

@janprill
Copy link

Seems to be a problem with the new Docker for Mac which is now in public beta. Same problem here. DOCKER_HOST is indeed not set in this situation. Docker VM is than a xhyve hypervisor. Tests with export DOCKER_VM_IP=docker run --rm --net host alpine ip addr show eth0 | sed -En "s/^.*inet (.+)\/.*$/\1/p" get you an IP address. But this address doesn't publish on port 2375. Maybe someone with more insight into the xhyve mechanics could clear this up.

@cdrage
Copy link
Contributor Author

cdrage commented Jun 21, 2016

@j00bar

▶ echo $DOCKER_HOST


~                                                                              
▶ 

Errr what?

xD

@cdrage
Copy link
Contributor Author

cdrage commented Jun 21, 2016

Using Debian 8 ^^

@j00bar
Copy link
Contributor

j00bar commented Jun 21, 2016

So @cdrage - check in our docs the section about configuring your Docker daemon: https://docs.ansible.com/ansible-container/installation.html#configuring-docker

@janprill - That issue is open in #27

@j00bar
Copy link
Contributor

j00bar commented Jun 21, 2016

Please reopen if after ensuring your Docker engine is configured properly, you still have issues.

@j00bar j00bar closed this as completed Jun 21, 2016
@cdrage
Copy link
Contributor Author

cdrage commented Jun 21, 2016

@j00bar shouldn't this be more explicit / error out when actually running ansible-container? Ideally (similar to the docs) you should be able to simply do ansible-container init then ansible-container build and run

@j00bar
Copy link
Contributor

j00bar commented Jun 21, 2016

I'll agree about an explicit error message. I'll open a new issue for that.

@remyleone
Copy link

@j00bar I got the same problem and the link you posted: https://docs.ansible.com/ansible-container/installation.html#configuring-docker doesn't work anymore. There is no section configuring-docker

@chouseknecht
Copy link
Contributor

@sieben, can you open a new issue and share your container.yml, main.yml, ansible-container --debug version output, along with any salient output from ansible-container --debug build, and I'll attempt to trouble shoot on this end. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants