Skip to content

Commit

Permalink
HAWQ-1655. Fix doc and makefile issue for hawq-docker
Browse files Browse the repository at this point in the history
  • Loading branch information
ginobiliwang authored and rlei committed Aug 21, 2018
1 parent 5d6afbe commit 0a271bc
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 6 deletions.
11 changes: 9 additions & 2 deletions contrib/hawq-docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,15 @@ remove-data:

pull:
@echo latest images
docker pull hawq/hawq-dev:$(OS_VERSION)
docker pull hawq/hawq-test:$(OS_VERSION)
#There is no hawq repo in docker.io currently, we just build up a local repo to mimic the docker registry here.
#For remote registry.
#docker pull hawq/hawq-dev:$(OS_VERSION)
#docker pull hawq/hawq-test:$(OS_VERSION)
#For local registry, user need to install local registry and push images before following steps.
docker pull localhost:5000/hawq-dev:$(OS_VERSION)
docker pull localhost:5000/hawq-test:$(OS_VERSION)
docker tag localhost:5000/hawq-dev:$(OS_VERSION) hawq/hawq-dev:$(OS_VERSION)
docker tag localhost:5000/hawq-test:$(OS_VERSION) hawq/hawq-test:$(OS_VERSION)

clean:
@make -f $(THIS_MAKEFILE_PATH) stop 2>&1 >/dev/null || true
Expand Down
38 changes: 34 additions & 4 deletions contrib/hawq-docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ https://docs.docker.com/
git clone https://github.com/apache/incubator-hawq.git .
cd incubator-hawq/contrib/hawq-docker
```
* Get the docker images
* Build the docker images
```
make pull (recommended)
OR
make build
```
(Command `make pull` is to pull docker images from Docker Hub, while command `make build` is to build docker images locally. In general, `make pull` is faster than `make build`.)
(Command `make build` is to build docker images locally.)
* setup a 5 nodes virtual cluster for Apache HAWQ build and test.
```
make run
Expand Down Expand Up @@ -83,6 +81,38 @@ Type "help" for help.
postgres=#
```
# Store docker images in local docker registry

After your hawq environment is up and running, you could draft a local docker registry to store your hawq images locally for further usage.
* pull and run a docker registry
```
docker pull registry
docker run -d -p 127.0.0.1:5000:5000 registry
```
Make sure you could get the following output
```
curl http://localhost:5000/v2/_catalog
{"repositories":[]}
```
You could push your local hawq images to local repository, let us use "centos7" as example
```
docker tag hawq/hawq-test:centos7 localhost:5000/hawq-test:centos7
docker tag hawq/hawq-dev:centos7 localhost:5000/hawq-dev:centos7
docker push localhost:5000/hawq-test
docker push localhost:5000/hawq-dev
```
Now the local registry has images in it
```
curl http://localhost:5000/v2/_catalog
{"repositories":["hawq-dev","hawq-test"]}
```

If we want to pull the images from local repo
```
make pull
```


# More command with this script
```
Usage:
Expand Down

0 comments on commit 0a271bc

Please sign in to comment.