Test data migration with docker
- 1 Install docker locally
- 2 Git is installed in the Vagrant
- 3 Git is not installed in the Vagrant
- 3.1 Build docker image
- 3.1.1 Native docker CLI
- 3.1.1.1 Build image :
- 3.1.1.2 Push image
- 3.1.1.3 Manually pull image into Vagrant box
- 3.1.1.4 Rename tag
- 3.1.1.5 Upgrade module
- 3.1.2 Maven plugins
- 3.1.1 Native docker CLI
- 3.1 Build docker image
There are several ways how to build docker image : Maven plugins, Gradle plugins, Native docker CLI.
Install docker locally
Windows
https://docs.docker.com/desktop/windows/install/
Linux
Git is installed in the Vagrant
Git is not installed in the Vagrant
Build docker image
Native docker CLI
Go to the root folder of one of the modules and check that file Dockerfile exists. Based on Dockerfile docker image will be build.
For example mod-invoice-storage
Build image :
docker build -t <hub-user>/<repo-name>[:<tag>]Example :
docker build -t testuser/private-repo:mod-invoice-storage-5.2.0-SNAPSHOT.500 .Push image
Create user in the https://hub.docker.com/ if needed
Login into https://hub.docker.com/ if needed before run push command : docker login
Push
docker push [OPTIONS] NAME[:TAG]Example :
docker push testuser/private-repo:mod-invoice-storage-5.2.0-SNAPSHOT.500Manually pull image into Vagrant box
Run Vagrant box and enter via SSH
Login into https://hub.docker.com/ : sudo docker login
Pull image
docker pull [OPTIONS] NAME[:TAG|@DIGEST]Example :
sudo docker pull testuser/private-repo:mod-invoice-storage-5.2.0-SNAPSHOT.500Rename tag
sudo docker tag testuser/private-repo:mod-invoice-storage-5.2.0-SNAPSHOT.500 docker.ci.folio.org/testuser/private-repo:mod-invoice-storage-5.2.0-SNAPSHOT.500Note : for success deploy module from docker container mandatory : docker.ci.folio.org/testuser/private-repo
Upgrade module
Old version of the module should be installed. For our example : mod-invoice-storage-5.2.0-SNAPSHOT.499
Assign okapi.all permissions to diku_admin :
Run migration collection for check
Rename "dockerImage" to your path in the Docker Hub in the step "Deploy mod-orders-storage 13.0.3 my docker"