在Fedora 23 配置 PostgreSQL 的 Docker CentOS编译环境

本文介绍了在Linux环境下Docker的安装步骤,并详细记录了通过Docker进行PostgreSQL数据库编译的过程,包括创建自定义镜像、配置编译参数等关键环节。

1、sudo yum install docker

2、安装之后服务并不会自动启动:
systemctl status docker.service

[quanzl@postgresdata applications]$ systemctl status docker.service
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: http://docs.docker.com

3、启动服务
sudo systemctl start docker.service

4、获取CentOS image
sudo docker pull centos:6.8
完整版本列表见:https://hub.docker.com/_/centos/

5、创建自己的 image
sudo docker commit axxxxxxxxxxb flying/pgsql-devel

6、运行
sudo docker run -ti flying/pgsql-devel

至此,剩下的步骤跟普通Linux没什么区别,过程中遇到的唯一问题是不使用sudo会报“docker: Cannot connect to the Docker daemon.”

7、编译参数(Docker中运行)
我自己常用的:./configure --prefix=/opt/PostgreSQL/9.6b4 --without-ldap --with-openssl --without-perl --without-python --without-tcl --without-pam --enable-thread-safety --with-libxml --without-ossp-uuid --with-libxslt --without-selinux --with-libedit-preferred --without-gssapi --disable-rpath
上述参数需要如下包支持(可能仍不完整):
yum install gcc flex bison openssl-devel zlib-devel libedit-devel libxml2-devel libxslt-devel perl

 

补充:

1、传递文件至容器有点麻烦,见《使用docker,不要用ssh连接到你的container 》
http://snoopyxdy.blog.163.com/blog/static/601174402014720113318508/
官方关于这个问题应该是持支持态度:
https://docs.docker.com/engine/examples/running_ssh_service/

我的办法是在容器里边安装 openssh-clients,然后从host拷贝文件过来。

2、发现命令 cp,这应该才是文件拷贝的正确途径
只是对于交互式编译来说,似乎不是非常适用

转载于:https://my.oschina.net/quanzl/blog/741713

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值