未验证 提交 48fb29ab 编写于 作者: L Lav Jain 提交者: GitHub

Update readme instructions for using docker for building GPDB (#4424)

* Update readme instructions for using docker for building GPDB
上级 4645fb87
......@@ -185,69 +185,16 @@ See [more information about gpperfmon here](gpAux/gpperfmon/README.md)
gpperfmon is dependent on several libraries like apr, apu, and libsigar
## Development with Native Docker Client
## Development with Docker
See [README.docker.md](README.docker.md).
## Development with Docker Machine
We provide a docker image with all dependencies required to compile and test
GPDB. You can view the dependency dockerfile at `./src/tools/docker/base/Dockerfile`.
The image is hosted on docker hub at `pivotaldata/gpdb-devel`. This docker
image is currently under heavy development.
GPDB [(See Usage)](src/tools/docker/README.md). You can view the dependency dockerfile at `./src/tools/docker/centos6-admin/Dockerfile`.
The image is hosted on docker hub at `pivotaldata/gpdb-dev:centos6-gpadmin`.
A quickstart guide to Docker can be found on the [Pivotal Engineering Journal](http://engineering.pivotal.io/post/docker-gpdb/).
Known issues:
* The `installcheck-world` make target has at least 4 failures, some of which
are non-deterministic
### Running regression tests with Docker
1. Create a docker host with 8GB RAM and 4 cores
```bash
docker-machine create -d virtualbox --virtualbox-cpu-count 4 --virtualbox-disk-size 50000 --virtualbox-memory 8192 gpdb
eval $(docker-machine env gpdb)
```
1. Build your code on gpdb-devel rootfs
```bash
cd [path/to/gpdb]
docker build .
# image beefc4f3 built
```
The top level Dockerfile will automatically sync your current working
directory into the docker image. This means that any code you are working
on will automatically be built and ready for testing in the docker context
1. Log into docker image
```bash
docker run -it beefc4f3
```
1. As `gpadmin` user run `installcheck-world`
```bash
su gpadmin
cd /workspace/gpdb
make installcheck-world
```
### Caveats
* No Space Left On Device:
On macOS the docker-machine vm can periodically become full with unused images.
You can clear these images with a combination of docker commands.
```bash
# assuming no currently running containers
# remove all stopped containers from cache
docker ps -aq | xargs -n 1 docker rm
# remove all untagged images
docker images -aq --filter dangling=true | xargs -n 1 docker rmi
```
* The Native macOS docker client available with docker 1.12+ (beta) or
Community Edition 17+ may also work
## Development with Vagrant
There is a Vagrant-based [quickstart guide for developers](src/tools/vagrant/README.md).
......
# Docker container with GPDB for development/testing
## Build locally
```
# Centos 6 (include dependencies for building GPDB)
docker build -t local/gpdb-dev:centos6 centos6
# Add gpadmin user to Centos 6 (gpdb cannot run as root)
docker build --build-arg REPO_OWNER=local -t local/gpdb-dev:centos6-gpadmin centos6-gpadmin
# Centos 7 (include dependencies for building GPDB)
docker build -t local/gpdb-dev:centos7 centos7
# Add gpadmin user to Centos 7 (gpdb cannot run as root)
docker build --build-arg REPO_OWNER=local -t local/gpdb-dev:centos7-gpadmin centos7-gpadmin
```
OR
## Download from docker hub
```
docker pull pivotaldata/gpdb-dev:centos6-admin
docker pull pivotaldata/gpdb-dev:centos7-admin
```
# Build GPDB code with Docker
### Clone GPDB repo
```
git clone https://github.com/greenplum-db/gpdb.git
cd gpdb
```
### Use docker image based on gpdb/src/tools/docker/centos7-gpadmin
```
docker run -w /home/build/gpdb -v ${PWD}:/home/build/gpdb:cached -it pivotaldata/gpdb-dev:centos7-gpadmin /bin/bash
```
docker build -t pivotaldata/gpdb-dev:centos6 centos6
docker build -t pivotaldata/gpdb-dev:centos6-gpadmin centos6-gpadmin
docker build -t pivotaldata/gpdb-dev:centos7 centos7
docker build -t pivotaldata/gpdb-dev:centos7-gpadmin centos7-gpadmin
### Inside docker
(Total time to build and run ~ 15-20 min)
```
# ORCA is disabled here to keep the instructions simple
./configure --enable-debug --with-perl --with-python --with-libxml --disable-orca --prefix=/usr/local/gpdb
make -j4
# Install Greenplum binaries (to /usr/local/gpdb)
make install
# Create a single node demo cluster with three segments
# PGPORT is set to 15432
source /usr/local/gpdb/greenplum_path.sh
make create-demo-cluster
source ./gpAux/gpdemo/gpdemo-env.sh
# Create and use a test database
createdb greenplum
psql -d greenplum
```
\ No newline at end of file
FROM pivotaldata/gpdb-dev:centos6
ARG REPO_OWNER=pivotaldata
FROM ${REPO_OWNER}/gpdb-dev:centos6
# create user gpadmin since GPDB cannot run under root
RUN groupadd -g 1000 gpadmin && useradd -u 1000 -g 1000 gpadmin && \
......
FROM pivotaldata/gpdb-dev:centos7
ARG REPO_OWNER=pivotaldata
FROM ${REPO_OWNER}/gpdb-dev:centos7
# create user gpadmin since GPDB cannot run under root
RUN groupadd -g 1000 gpadmin && useradd -u 1000 -g 1000 gpadmin && \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册