cannot run container after commit changes
Just basic and simple steps illustrating what I have tried:
- docker pull mysql/mysql-server
- sudo docker run -i -t mysql/mysql-server:latest /bin/bash
- yum install vi
- vi /etc/my.cnf -> bind-address=0.0.0.0
- docker ps
- docker commit new_image_name
- docker run –name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=secret -d new_image_name
docker ps -a STATUS – Exited (1)
Please let me know what I did wrong.
One Solution collect form web for “cannot run container after commit changes”
Instead of trying to modify an existing image, try and use (for testing)
That would allow root login from any IP. (As seen in docker-library/mysql issue 241)
sudo docker run --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 -e MYSQL_ROOT_HOST=% -d mysql/mysql-server:latest
By default, MySQL creates the
This account can only be connected to from inside the container, requiring the use of the
docker execcommand as noted under Connect to MySQL from the MySQL Command Line Client.
To allow connections from other hosts, set this environment variable.
As an example, the value “
172.17.0.1“, which is the default Docker gateway IP, will allow connections from the Docker host machine.