Skip to content
This repository has been archived by the owner on Jul 3, 2020. It is now read-only.

App Container will shutdown #3

Closed
Isengo1989 opened this issue Oct 30, 2017 · 6 comments
Closed

App Container will shutdown #3

Isengo1989 opened this issue Oct 30, 2017 · 6 comments

Comments

@Isengo1989
Copy link

Isengo1989 commented Oct 30, 2017

I tried this script - everything was build sucsessfully, but the shopwaredocker_app_server Image Container seems to exit right away. I fixed the same problem with the redis Container by setting the chmod to 777. Any Idea how to fix this?

Ubuntu 17.04
Docker version 17.09.0-ce, build afdb6d4
docker-compose version 1.16.1, build 6d1ac21

(4/6) Starting
> wait
	
(5/6) Starting
> echo "All containers started successfully"
	All containers started successfully
	
(6/6) Starting
> echo "Web server IP: http://10.100.111.46"
	Web server IP: http://10.100.111.46
	
Duration: 1s
All commands successfully executed!
micha@micha:~/docker/shopware/shopware-docker$ sudo ./psh.phar docker:ssh

###################
Starting Execution of 'docker:ssh' ('dev-ops/docker/actions/ssh.sh')


(1/1) Starting
> docker exec -i -u 0:0 -t a21983b0155ccd1e5042d2c27c14618fa5694007e72f312d3fd5fc29ee5afd2f bash
	Error response from daemon: Container a21983b0155ccd1e5042d2c27c14618fa5694007e72f312d3fd5fc29ee5afd2f is not running

Execution aborted, a subcommand failed!
CONTAINER ID        IMAGE                       COMMAND                  CREATED             STATUS                     PORTS                                            NAMES
a21983b0155c        shopwaredocker_app_server   "docker-php-entryp..."   11 minutes ago      Exited (1) 7 minutes ago                                                    shopwaredocker_app_server_1
1be6c5f4f2a6        shopwaredocker_app_es       "/bin/bash bin/es-..."   11 minutes ago      Up 11 minutes              0.0.0.0:9200->9200/tcp, 0.0.0.0:9300->9300/tcp   shopwaredocker_app_es_1
d9f49959e9a5        shopwaredocker_app_redis    "docker-entrypoint..."   11 minutes ago      Up 11 minutes              6379/tcp                                         shopwaredocker_app_redis_1
d46b42cd4769        shopwaredocker_app_mysql    "docker-entrypoint..."   11 minutes ago      Up 11 minutes              3306/tcp                                         shopwaredocker_app_mysql_1

docker start -a CONTAINERID actually gives me an error referring to a invalid user:

chown: invalid user: 'app-shell:app-shell'
Agent pid 12
Identity added: /home/app-shell/.ssh/id_rsa (rsa w/o comment)
AH00543: apache2: bad user name app-shell

@teiling88
Copy link
Contributor

I can't reproduce this issue.

It is possible that the create_user.sh script failed on your system?

@Isengo1989
Copy link
Author

It seems like I cannot get the ${USERID} and ${GROUP} in the Shellscript.

@Isengo1989
Copy link
Author

That is it content of shopware-docker/dev-ops/docker/containers/mysql/createuser.sh

userid and groupid are 0

#!/usr/bin/env bash

groupadd -g 0 app-mysql
useradd -s /bin/bash -m -u 0 -g 0 app-mysql
mkdir -p /home/app-mysql/.ssh
chown -R app-mysql:app-mysql /home/app-mysql
echo -e "app-mysql\napp-mysql\n" | passwd app-mysql
echo 'app-mysql  ALL=(ALL:ALL) ALL' >> /etc/sudoers

@teiling88
Copy link
Contributor

Can you please post the result of this command:

echo "$(id -u):$(id -g)"

@Isengo1989
Copy link
Author

echo "$(id -u):$(id -g)"
1000:1000

I think it is because I executed ./psh.phar docker:start before with sudo - so it used the root ID in the createuser.sh Script. I delted the generated files in dev-ops/docker/containers/mysql and dev-ops/docker/containers/php7 and executed ./psh.phar docker:start without sudo - but then I get

> docker-compose build && docker-compose up -d
	Building app_mysql
	Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
	
	If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.

Do I need sudo for docker-compose in this case? My user is in the docker group already

groups $USER
micha : micha .......... docker

@Isengo1989
Copy link
Author

Oh well - permissions...

My docker-compose file was root and I could not execute it with my user. A reboot did the trick, I guess even after changing it it stayed cached somehow with the wrong permissions in /usr/local/bin/

Everything works fine now - except ES, I guess it's just setting it to 777.

Thanks for the fast response.

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

2 participants