0

i try to start two detached containers.

first a MySql

docker run -td --name mysql -p 3306:3306 -e MYSQL_PASS="admin" tutum/mysql

the i try to start a self built container for apache, typo3

docker run -td --name typo -p 80:80 --link mysql:mysql thomasm/typo3-45

i would now expect that the two containers show up in docker ps

$ docker ps
CONTAINER ID        IMAGE                COMMAND             CREATED             STATUS              PORTS                    NAMES
96607b9ee0f9        tutum/mysql:latest   "/run.sh"           19 minutes ago      Up 19 minutes       0.0.0.0:3306->3306/tcp   mysql,typo/mysql

but both seem to be in this one container id (watch the NAMES column).

docker ps -a now shows that the "typo" container has exited

$ docker ps -a
CONTAINER ID        IMAGE                           COMMAND                CREATED             STATUS                          PORTS                    NAMES
4d5ab7351d49        thomasm/typo3-45:latest         "/start.sh"            8 minutes ago       Exited (0) 8 minutes ago                                 typo          

I'm a bit confused. Why does the typo name show up in the names column of the mysql container. And why does the typo container exit? I don't see any error messages. Non detached, with bash the typo container works...

output from docker logs

$ docker logs typo 
* Starting web server apache2                                                  
AH00558:      apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.16. 
Set the 'ServerName' directive globally to suppress this message

*

errordeveloper
  • 6,716
  • 6
  • 41
  • 54
tommsen
  • 227
  • 1
  • 2
  • 8

1 Answers1

0

Why does the typo name show up in the names column of the mysql container

because they are linked together

why does the typo container exit?

You might find clues by running docker logs typo. A common mistake is to have the container run the process in the background instead of in the foreground.

Thomasleveil
  • 95,867
  • 15
  • 119
  • 113
  • what do you mean exactly by "run the process in the background instead of the foreground"? Apache is always running in background, isn't it? – tommsen Oct 23 '14 at 12:25
  • 1
    ok, got what you mean. starting apache now with apachectl -DFOREGROUND – tommsen Oct 23 '14 at 12:35