Warning: mysqli_num_fields() expects parameter 1 to be mysqli_result, boolean given in /www/wwwroot/dev.zhalaotie.com/wp-includes/wp-db.php on line 3215

Warning: mysqli_num_fields() expects parameter 1 to be mysqli_result, boolean given in /www/wwwroot/dev.zhalaotie.com/wp-includes/wp-db.php on line 3215
How can I add a volume to an existing Docker container? – 扎老铁
Warning: mysqli_num_fields() expects parameter 1 to be mysqli_result, boolean given in /www/wwwroot/dev.zhalaotie.com/wp-includes/wp-db.php on line 3215

Warning: mysqli_num_fields() expects parameter 1 to be mysqli_result, boolean given in /www/wwwroot/dev.zhalaotie.com/wp-includes/wp-db.php on line 3215
Warning: mysqli_num_fields() expects parameter 1 to be mysqli_result, boolean given in /www/wwwroot/dev.zhalaotie.com/wp-includes/wp-db.php on line 3215
class="post-53361 post type-post status-publish format-standard hentry">

How can I add a volume to an existing Docker container?

You can commit your existing container (that is create a new image from container’s changes) and then run it with your new mounts.

Example:

$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5a8f89adeead ubuntu:14.04 “/bin/bash” About a minute ago Exited (0) About a minute ago agitated_newton

$ docker commit 5a8f89adeead newimagename

$ docker run -ti -v “$PWD/dir1”:/dir1 -v “$PWD/dir2”:/dir2 newimagename /bin/bash
If it’s all OK, stop your old container, and use this new one.

That´s it 🙂

https://stackoverflow.com/questions/28302178/how-can-i-add-a-volume-to-an-existing-docker-container

发表评论

电子邮件地址不会被公开。