Prerequisites
Make sure to download the docker image you want to use for the udpate before moving on.
You can simply pull the desired version using the following command
docker pull simplifierag/runtime:<VERSIONNUMBER>
Example:
docker pull simplifierag/runtime:7.0 (will pull the latest version of release 7.0)
During this article the new image will be represented by <NEWIMAGE>
Step 1 – Find the correct docker (<DOCKERNAME>)
List all available dockers by using the following command
docker ps -a
and copy the name of the docker you want to update.
During this article this will be represented by <DOCKERNAME>
Step 2 – Inspect docker to copy configuration
Inspect the correct docker by using the following command
docker inspect <DOCKERNAME>
Example:
docker inspect simplifier-develop
In the following sub steps we’ll list attributes you need to check and save so the configuration of the new docker is the same as the old one
Step 2.1 – Mounts (<VOLUMES>)
You can find the volume configuration listed as “Mounts“. For each listed volume the Source and Destination parameters will be needed for the update.
Example excerpt from the docker inspect command:
"Mounts": [ { "Type": "bind", "Source": "/opt/simplifier/data/simplifier-develop", "Destination": "/opt/simplifier/data", "Mode": "", "RW": true, "Propagation": "rprivate" } ]
Each <VOLUME> parameter consists of -v <SOURCE>:<DESTINATION>
Example:
-v /opt/simplifier/data/simplifier-develop:/opt/simplifier/data
During this article the list of volumes will be represented by <VOLUMES>
Step 2.2 – Environment variables (<ENV>)
You can find the environmenta variable configuration listed as “Env” nested under the “Config” parameter. Each environment variable will be needed for the update.
Example excerpt from the docker inspect command:
"Config": { "Env": [ "MYSQL_DB=simplifier-develop", "MYSQL_USER=simplifier-develop", "VIRTUAL_HOST=simplifier-develop.myServer.com", "PLUGINLIST=keyValueStorePlugin,pdfPlugin,captcha,contentRepoPlugin,jsonStore,wordGeneratorPlugin", "DB=mysql", "MYSQL_HOST=mysql", "MYSQL_PORT=3306", "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "LANG=en_US.UTF-8" ] }
Each <ENV> parameter consists of -e <VARIABLE>.
Please make sure the values are not including the quotes!
Example:
-e MYSQL_DB=simplifier-develop -e MYSQL_USER=simplifier-develop -e PLUGINLIST=keyValueStorePlugin,pdfPlugin,captcha,contentRepoPlugin,jsonStore,wordGeneratorPlugin
During this article the list of environment variables will be represented by <ENV>
Step 2.3 – Networks (<NETWORKS>)
You can find the network configuration listed as “Networks” nested under the “NetworkSettings ” parameter. Each network will be needed for the update.
Example excerpt from the docker inspect command:
"NetworkSettings": { "Networks": { "MyNetWork": { ... } } }
Each <NETWORK> parameter consists of – -net=<NETWORKNAME>.
Example:
--net=MyNetWork
During this article the list of environment variables will be represented by <NETWORKS>
Step 2.4 – Network ports (<PORTS>)
You can find the ports configuration listed as “Ports” nested under the “NetworkSettings ” parameter. Each port will be needed for the update.
Example excerpt from the docker inspect command:
"NetworkSettings": { "Ports": { "3306/tcp": null, "443/tcp": null, "80/tcp": null, "8080/tcp": [ { "HostIp": "0.0.0.0", "HostPort": "8080" } ], "8090/tcp": null, } }
Each <NETWORK> parameter consists of -p <HOSTPORT>:<PORT>.
Example:
-p 8080:8080
During this article the list of environment variables will be represented by <PORTS>
Step 3 – Stop and remove current docker
Before updating the docker image the current active one has to be stopped and removed using the following command:
docker stop <DOCKERNAME> && docker rm <DOCKERNAME>
Example:
docker stop simplifier-develop && docker rm simplifier-develop
Step 4 – Restart docker using the new image
Starting the docker is done using the following command:
docker run -d --name <DOCKERNAME> <VOLUMES> <ENV> <PORTS> <NETWORK> --restart=always -h run <NEWIMAGE>
Example:
docker run -d --name simplifier-develop -v /opt/simplifier/data/simplifier-develop:/opt/simplifier/data -e MYSQL_DB=simplifier-develop -e MYSQL_USER=simplifier-develop -e PLUGINLIST=keyValueStorePlugin,pdfPlugin,captcha,contentRepoPlugin,jsonStore,wordGeneratorPlugin -p 8080:8080 --net=MyNetWork --restart=always -h run simplifierag/runtime:7.0