Difference between revisions of "Upgrade Docker container"
(→Start the upgra process) |
|||
Line 18: | Line 18: | ||
</pre> | </pre> | ||
− | == | + | == Prepare for the upgrade == |
Download the upgrade package for LD 8.6.1 from http://network.logicaldoc.com/ and copy it from the host to the container instance. | Download the upgrade package for LD 8.6.1 from http://network.logicaldoc.com/ and copy it from the host to the container instance. | ||
Note that the file will be copied to the directory prepared to contain the update packages | Note that the file will be copied to the directory prepared to contain the update packages | ||
+ | <pre> | ||
docker cp ldoc_upd-00000086.zip <Logicaldoc-container-name>:/LogicalDOC/updates/ | docker cp ldoc_upd-00000086.zip <Logicaldoc-container-name>:/LogicalDOC/updates/ | ||
+ | </pre> | ||
The upgrade package ldoc_upd-00000086.zip will upgrade the system from version 8.6.1 to version 8.7 | The upgrade package ldoc_upd-00000086.zip will upgrade the system from version 8.6.1 to version 8.7 | ||
+ | |||
+ | Create image (snapshot) from container filesystem | ||
+ | <pre> | ||
+ | docker commit <Logicaldoc-container-ID> mysnapshot | ||
+ | </pre> | ||
+ | |||
+ | Use the inspect command to inspect the location of /conf and /repository directories | ||
+ | <pre> | ||
+ | docker inspect <Logicaldoc-container-name> | ||
+ | </pre> | ||
+ | |||
+ | I capture the paths of the /conf and /repository directories of the current Logicaldoc container and replace them for the snapshot image. | ||
+ | |||
+ | <pre> | ||
+ | docker run -ti -v /var/lib/docker/volumes/89bbc84f2bc8ed5d748710876bde62ac30d065fbb582888bec52b2bcf2542a47/_data:/LogicalDOC/conf -v /var/lib/docker/volumes/353b4ee020551ccadb668353dedac87f9706a277d027b9a9993e096462a1ff1e/_data:/LogicalDOC/repository --link mysqlld861 mysnapshot /bin/bash | ||
+ | </pre> | ||
+ | |||
+ | Notice the mapping of /LogicalDOC/conf and /LogicalDOC/repository | ||
+ | Of course the MySQL container should be connected |
Revision as of 10:46, 10 December 2021
Initial Situation
Here is how you usually start a Docker container with LogicalDOC connected to a MySQL 8.0 container for DB engine
Get the LogicalDOC 8.6.1 image
docker pull logicaldoc/logicaldoc:8.6.1
Run the MySQL container
docker run --name=mysqlld861 -e MYSQL_ROOT_PASSWORD=mypassword -e MYSQL_DATABASE=logicaldoc -e MYSQL_USER=ldoc -e MYSQL_PASSWORD=changeme mysql:latest --default-authentication-plugin=mysql_native_password
Run the LogicalDOC container connected to the MySQL one
docker run -p 8080:8080 -e LDOC_USERNO=543645 -e DB_HOST=mysqlld861 --link mysqlld861 logicaldoc/logicaldoc:8.6.1
Prepare for the upgrade
Download the upgrade package for LD 8.6.1 from http://network.logicaldoc.com/ and copy it from the host to the container instance. Note that the file will be copied to the directory prepared to contain the update packages
docker cp ldoc_upd-00000086.zip <Logicaldoc-container-name>:/LogicalDOC/updates/
The upgrade package ldoc_upd-00000086.zip will upgrade the system from version 8.6.1 to version 8.7
Create image (snapshot) from container filesystem
docker commit <Logicaldoc-container-ID> mysnapshot
Use the inspect command to inspect the location of /conf and /repository directories
docker inspect <Logicaldoc-container-name>
I capture the paths of the /conf and /repository directories of the current Logicaldoc container and replace them for the snapshot image.
docker run -ti -v /var/lib/docker/volumes/89bbc84f2bc8ed5d748710876bde62ac30d065fbb582888bec52b2bcf2542a47/_data:/LogicalDOC/conf -v /var/lib/docker/volumes/353b4ee020551ccadb668353dedac87f9706a277d027b9a9993e096462a1ff1e/_data:/LogicalDOC/repository --link mysqlld861 mysnapshot /bin/bash
Notice the mapping of /LogicalDOC/conf and /LogicalDOC/repository Of course the MySQL container should be connected