I have followed this answer(Duplicating docker container for debugging), but even when executing 1st line of code:
docker run -it <base_image> /bin/bash
I got such error: docker: Error response from daemon: Not found. See 'docker run --help'.
I guess code above is to create new container based on existing image. Then following 2 lines of code:
yum install ping
docker commit <hash tag of running container> new_image
They install ping tool to that new container and then export it as a new image.
Please correct me if my previous understand is not true.
But for me, after cloning magento/maraidb container, I still want them to use the same images file. (just change some config in {{.Config.Env}}
-------- UPDATE: -- Now I don't mind if save changes to new images and create container on top of new containers ----------------
I follow your suggestion and did make sure docker daemon is running. I also did pull first via:
docker pull bitnami/mariadb:latest
docker pull bitnami/magento:latest
As I still need to export all these changes in containers to new images, I did that:
docker commit {container A}bitnami/mariadb:newname
docker commit {container B} bitnami/magento:newname
Then if I use the new image for 'Docker run....', I got this error:
INFO ==> Starting mysqld_safe...
mariadb_1 | Could not open required defaults file: /opt/bitnami/mariadb/conf/my.cnf
mariadb_1 | Fatal error in defaults handling. Program aborted
mariadb_1 | WARNING: Defaults file '/opt/bitnami/mariadb/conf/my.cnf' not found!
mariadb_1 | Could not open required defaults file: /opt/bitnami/mariadb/conf/my.cnf
mariadb_1 | Fatal error in defaults handling. Program aborted
mariadb_1 | WARNING: Defaults file '/opt/bitnami/mariadb/conf/my.cnf' not found!
mariadb_1 | 170330 00:04:40 mysqld_safe Logging to '/opt/bitnami/mariadb/data/4bdcd2db9267.err'.
mariadb_1 | 170330 00:04:40 mysqld_safe Starting mysqld daemon with databases from /opt/bitnami/mariadb/data
mariadb_1 | /opt/bitnami/mariadb/bin/mysqld_safe_helper: Can't create/write to file '/opt/bitnami/mariadb/data/4bdcd2db9267.err' (Errcode: 2 "No such file or directory")
-------- UPDATE2: -- Maybe previously I might haven't said clearly. Here are my steps:----------------
1, Use docker-compose and docker-compose.yml to create 1 Magento & MariaDB container. The images are: magento:latest and mariadb:latest
2, Then I login to Magento and made few system changes. What I want next is to create/export/commit current container to new images, e.g. call them magento:sam and mariadb:sam. The command I use is: docker commit {container id} magento:sam.
3, Before previous step, I also used: docker pull magento:latest (I follow other people's suggestion as they said some data might not store in container and needs to pull first ----- If it's wrong, please point out.)
4, After new image created, then I use: docker -ti -p 81:81 magento:sam try to create new container based on new image. But get message and error message as:
Welcome to the magento image ***
Brought to you by Bitnami ***
More information: https://github.com/bitnami/bitnami-docker-magento ***
Issues: https://github.com/bitnami/bitnami-docker-magento/issues ***
New version available: run docker pull bitnami/magento:2.1.5-r2 to update. ***
**nami ERROR Unable to start com.bitnami.apache: httpd: Could not open configuration file /opt/bitnami/apache/conf/httpd.conf: No such file or directory**
Please help which step is wrong or missing any steps. Thanks again!