先建立一个yml文件,内容如下:
version: '3.8' services: opengauss: image: docker.hub/enmotech/opengauss:6.0.0 container_name: OpenGauss environment: - GS_PASSWORD=Lxm - GS_USERNAME=tester ports: - "5432:5432" volumes: - /etc/localtime:/etc/localtime - /database/opengauss/file:/var/lib/opengauss restart: always privileged: true user: root
这里的docker.hub改成你自己的镜像地址,用的是enmotech/opengauss镜像。跑起来后,进入容器:
su - omm gsql -d postgres -p 5432
如果看到下面的提示,则是安装成功了:
gsql ((openGauss 6.0.0 build aee4abd5) compiled at 2024-09-29 19:14:27 commit 0 last mr ) Non-SSL connection (SSL connection is recommended when requiring high-security)
更多内容可以参考这篇文章,写的很详细:
https://blog.csdn.net/qq_40673755/article/details/143849378
将tester用户转成管理员(后面的分号一定要加):
alter user tester sysadmin; GRANT ALL ON schema public TO tester;