ubuntu 12.04 into docker “service mysql start”
If you read above thread you can see that Docker
doesn't have any runlevel so mysql doesn't know when it should start.
You can run two container and create a nework between them. One for mysql and another for pythonapp. Here is how you can create a network between two container
docker network create <network_name>
Start the container attaching the container to new network using --net=<network_name>
docker run -d --net=anetwork --name=mysql -e MYSQL_USER=ROOT -e MYSQL_ALLOW_EMPTY_PASSWORD=yes mysql
docker run --net=anetwork --name=pythonapp -it python:2.7-wheezy bash

I think you are confused between ENTRYPOINT
and CMD
. The key point to understand is that an ENTRYPOINT
will always be run when the image is started, even if a command is supplied to the docker run invocation. If you try to supply a command, it will add that as an argument to the ENTRYPOINT
, replacing the default defined in the CMD instruction. You can only override the ENTRYPOINT
if you explicitly pass in an --entrypoint
flag to the docker run command.
This means that running the image with a /bin/bash
command will not give you a shell; rather it will supply /bin/bash
as an argument to the service mysql start
.
Network between container
ubuntu 12.04 into docker “service mysql start”
Difference Between CMD and ENTRYPOINT in Dockerfile