[openGauss] Using containerized mogeaver in windows
Published: 2022-09-08 11:23:14

foreword
This is an exploration of some functions currently exclusive to linux and implemented on windows, and it is not recommended to use them in production.

ideas
Currently, windows 10/11 supports building a docker environment without using a linux virtual machine
Docker on windows can use X11 tools such as VcXsrv or xming to display the graphical interface in the container to windows
The linux version of mogeaver is a GUI made of gtk
Therefore, in theory, we can find a docker image of the operating system, install the gtk and jdk environments, put the linux version of mogeaver in, and then use VcXsrv to set up a display on windows, start the container, and set the dispaly of the container to windows , you can use the linux version of mogeaver on windows.

issues that need resolving
It's best to find a docker image with a gtk environment, so that you don't need to build it yourself from scratch (haven't been exposed to gtk development before, in order to save time...)
Generally, the simplified docker image does not support Chinese fonts, so mogeaver cannot display Chinese fonts, and domestic Windows users should still prefer to use the Chinese interface
By default, the directory of client tools such as gs_dump/gsql is set in mogeaver to reduce the operation of user configuration environment User profile information needs to be persisted to the host to prevent the container configuration from being lost next time.
It is best to create a container every time you use mogeaver, and automatically delete the container when it is closed to save resources
The default yum repository source sometimes cannot be connected, and an alternate source is required, otherwise the image build may fail
semi-finished product
Project address:
https://gitee.com/darkathena/mogeaver-docker

Instructions for use
1、First make sure that docker-desktop is installed on the local windows and the service has been started
https://www.docker.com/get-started/

2、Download VcXsrv
https://sourceforge.net/projects/vcxsrv/


3、Install VcXsrv, all the way to the next step, then open XLaunch, all the way to the next step

4、Download the mogdb and mogeaver archives and put them in this folder
wget https://cdn-mogdb.enmotech.com/mogeaver/22.1.5/mogeaver-ce-22.1.5-linux.gtk.x86_64.tar.gz
wget https://cdn-mogdb.enmotech.com/mogdb-media/3.0.1/MogDB-3.0.1-CentOS-x86_64.tar.gz

5、Enter this directory and execute the build image command
docker build -t mogeaver-docker:latest .

6、After the build is complete, execute run_mogeaver.bat to start mogeaver

Personalized Modification Instructions

1、The default user configuration path is d:\MogeaverData, which can be changed by modifying the run_mogeaver.bat file
2、The default gs_dump export file path is d:\dump_data, which can be changed by modifying the run_mogeaver.bat file
3、If you need Chinese font support, please uncomment the "Chinese font support" section in the dockerfile
4、If you need to replace the domestic yum source, please uncomment the "change yum repo" section in the dockerfile

Features

1、The openGauss client command line tools have been integrated, such as gsql/gs_dump, etc., which can be called through mogeaver related functions
2、Close the program to delete the container to save memory resources