ybalt / ansible-tower

Ansible Tower dockerized
Apache License 2.0
104 stars 79 forks source link

permission denied for private key #4

Closed prees1 closed 7 years ago

prees1 commented 8 years ago

Have you tried to boot this image on docker cloud?

When I do I get the following error:

image

However running the image via docker-compose on my local machine does work. So this may be an issue with docker cloud specifically.

Any suggestions you have would be great. Thanks!

ybalt commented 8 years ago

No, I don't tried docker cloud, only local installation.

Really not sure it related to cloud as all filesystems are inside and specific to docker container, except mounted to ~/certs:/certs. If container is running on cloud, even with errors, you can check this file exists and its permissions by running bash inside container: docker exec -it bash and do ls -l to check permissions.

more info about this file http://askubuntu.com/questions/396120/what-is-the-purpose-of-the-ssl-cert-snakeoil-key

prees1 commented 8 years ago

I agree I don't think it should be related to cloud either, as its all in the container like you say.

Docker Cloud runs containers via Stackfiles, almost identical to how docker-compose runs containers, via a docker-compose.yml file.

They both use a yaml format to define the config for the container. Using the same config (below) with docker-compose and on Docker Cloud; it works on docker-compose (on my local machine) but on Docker Cloud the Stack fails to start, with the error in the above comment.

ansible:
  environment:
    - SERVER_NAME=localhost
  image: 'ybalt/ansible-tower:latest'
  ports:
    - '443:443'
    - '8080:8080'
  volumes:
    - '/root/certs:/certs'

When I run it locally I can check the permissions of that file in the container and it is:

-rw-r----- 1 root ssl-cert 1704 Dec 4 2015 /etc/ssl/private/ssl-cert-snakeoil.key

and if I add this line to the compose/Stackfile command: ls -l /etc/ssl/private/ssl-cert-snakeoil.key

I get the following permissions in the container on docker cloud:

2016-09-09T16:37:28.609839900Z -rw-r----- 1 root ssl-cert 1704 Dec 4 2015 /etc/ssl/private/ssl-cert-snakeoil.key

I am running Docker version 1.12.1, build 23cf638, experimental locally and my docker cloud node is running version 1.11.1-cs1.

So I guess, unless you have had specific issues with this file before. I can only assume it is something related to docker?

ybalt commented 8 years ago

May be it really related to docker, as I see you use 1.11.1-cs1 version, its unlikely to be "normal" release and may be a special edition, compiled for docker cloud. You can try to install 1.11.1 on local and check the behavior is the same