提交 8d557155 编写于 作者: L Lav Jain

Create a public dockerfile for compiling greenplum on ubuntu (#7330)

* Create a public dockerfile for compiling gpdb on ubuntu
* Create directory /usr/local/greenplum-db-devel for installing greenplum
* Move current ubuntu files to ubuntu16_ppa. Update readme
上级 7ea8f396
......@@ -3,11 +3,14 @@
## Build locally
```
# Centos 6 (include dependencies for building GPDB)
# Centos 6 (includes dependencies for building GPDB)
docker build -t local/gpdb-dev:centos6 centos6
# Centos 7 (include dependencies for building GPDB)
# Centos 7 (includes dependencies for building GPDB)
docker build -t local/gpdb-dev:centos7 centos7
# Ubuntu 16 (includes dependencies for building GPDB)
docker build -t local/gpdb-dev:ubuntu16 ubuntu16
```
OR
......@@ -15,21 +18,22 @@ OR
```
docker pull pivotaldata/gpdb-dev:centos6
docker pull pivotaldata/gpdb-dev:centos7
docker pull pivotaldata/gpdb-dev:ubuntu16
```
# Build GPDB code with Docker
### Clone GPDB repo
Clone GPDB repo
```
git clone https://github.com/greenplum-db/gpdb.git
cd gpdb
```
### Use docker image based on gpdb/src/tools/docker/centos7
Use docker image based on gpdb/src/tools/docker/centos7
```
docker run -w /home/build/gpdb -v ${PWD}:/home/build/gpdb:cached -it pivotaldata/gpdb-dev:centos7 /bin/bash
```
### Inside docker
Inside docker
(Total time to build and run ~ 15-20 min)
```
# ORCA is disabled here to keep the instructions simple
......@@ -50,6 +54,6 @@ createdb greenplum
psql -d greenplum
```
# Docker container with GPDB database running
For more information follow the [link](ubuntu-16.04/README.md)
# Docker container with Open source version of GPDB database running
For more information follow the [link](ubuntu16_ppa/README.md)
FROM ubuntu:16.04
RUN apt-get update -y && \
apt-get install -y --no-install-recommends apt-utils software-properties-common && \
apt-get install -y --no-install-recommends openjdk-8-jdk && \
add-apt-repository -y ppa:ubuntu-toolchain-r/test && \
apt-get update -y && \
apt-get install -y --no-install-recommends gcc-6 g++-6 cmake && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6 && \
update-alternatives --config gcc && \
gcc --version && g++ --version && \
apt-get install -y --no-install-recommends ant \
bison \
build-essential \
ccache \
curl \
dirmngr \
flex \
git-core \
iputils-ping \
jq \
libapr1-dev \
libbz2-dev \
libcurl4-gnutls-dev \
libevent-dev \
libkrb5-dev \
libpam-dev \
libperl-dev \
libreadline-dev \
libssl-dev \
libxerces-c-dev \
libxml2-dev \
libyaml-dev \
libzstd1-dev \
locales \
maven \
net-tools \
ninja-build \
openssh-server \
pkg-config \
python-dev \
python-lockfile \
python-paramiko \
python-pip \
python-psutil \
python-setuptools \
python-software-properties \
less \
rsync \
ssh \
sudo \
time \
vim \
wget \
zlib1g-dev && \
rm -rf /var/lib/apt/lists/*
# setup ssh configuration
RUN locale-gen en_US.UTF-8 && \
ssh-keygen -t rsa -N "" -f /root/.ssh/id_rsa && \
cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys && \
chmod 0600 /root/.ssh/authorized_keys && \
echo "root:password" | chpasswd 2> /dev/null && \
{ ssh-keyscan localhost; ssh-keyscan 0.0.0.0; } >> /root/.ssh/known_hosts && \
#
sed -i -e 's|Defaults requiretty|#Defaults requiretty|' /etc/sudoers && \
sed -ri 's/UsePAM yes/UsePAM no/g;s/PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config && \
sed -ri 's@^HostKey /etc/ssh/ssh_host_ecdsa_key$@#&@;s@^HostKey /etc/ssh/ssh_host_ed25519_key$@#&@' /etc/ssh/sshd_config && \
# create user gpadmin since GPDB cannot run under root
groupadd -g 1000 gpadmin && useradd -u 1000 -g 1000 gpadmin && \
echo "gpadmin ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/gpadmin && \
groupadd supergroup && usermod -a -G supergroup gpadmin && \
mkdir -p /home/gpadmin/.ssh && \
ssh-keygen -t rsa -N "" -f /home/gpadmin/.ssh/id_rsa && \
cat /home/gpadmin/.ssh/id_rsa.pub >> /home/gpadmin/.ssh/authorized_keys && \
chmod 0600 /home/gpadmin/.ssh/authorized_keys && \
echo "gpadmin:password" | chpasswd 2> /dev/null && \
{ ssh-keyscan localhost; ssh-keyscan 0.0.0.0; } >> /home/gpadmin/.ssh/known_hosts && \
chown -R gpadmin:gpadmin /home/gpadmin && \
mkdir /usr/local/greenplum-db-devel && \
chown gpadmin:gpadmin /usr/local/greenplum-db-devel
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册