Skip to content

Commit 837a3ef

Browse files
committed
Update docker/README.md
1 parent cb14d0f commit 837a3ef

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

docker/README.md

+11-12
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,41 @@
1-
# Build and Test in Docker Containers
1+
# GoHive: Build and Test in Docker Containers
22

33
GoHive is a Hive driver for Go's database API. To build and test it, we need not only the building tools but also Hive. For the convenience of contributors, we install all tools into a Docker image so could we run and test in a Docker container.
44

55
The general usage is that we check out the source code on the host computer, then we start a Docker container and run building tools in the container. The critical point is that we map the source code directory into the container. Feel free to use any of your favorite editor, Emacs, Vim, Eclipse, installed and running on the host.
66

7+
78
## Check out the Source Code
89

9-
The following command
10+
Run the following command to clone GoHive to `$GOPATH/src/sqlflow.org/gohive` on your host computer:
1011

1112
```bash
12-
go get github.com/sql-machine-learning/gohive
13+
go get sqlflow.org/gohive
1314
```
1415

15-
clones GoHive to `$GOPATH/src/github.com/sql-machine-learning/gohive`.
1616

1717
## Build the Docker Image
1818

19-
The following command
19+
Run the following command in the `/docker` directory to create the Docker image `gohive:dev`:
2020

2121
```bash
22-
docker build -t gohive:dev dockerfile
22+
cd gohive/docker
23+
docker build -t gohive:dev .
2324
```
2425

25-
in the Dockerfile directory creates the Docker image `gohive:dev`.
2626

27-
## Build and Test in a Container
27+
## Build and Test GoHive
2828

29-
The following command starts a container and maps the `$GOPATH` directory on the host to the `/go` directory in the container. Please be aware that the Dockerfile configures `/go` as the `$GOPATH` in the container.
29+
The following command starts a container with Hive running inside, so could we build and test GoHive:
3030

3131
```bash
3232
docker run --rm -it -v $GOPATH:/go \
3333
-w /go/src/github.com/sql-machine-learning/gohive \
3434
gohive:dev bash
3535
```
3636

37-
After the container prints many lines of logs showing that the Hive server is starting, we can build and run tests:
37+
The `-v` option maps `$GOPATH` on the host to `/go` in the container. Please be aware that the Dockerfile configures `/go` as the `$GOPATH` in the container. After many lines of logs scroll up while the Hive server starts, there comes the shell prompt, where we can run the following command to build and run tests:
3838

39-
```
40-
go build
39+
```bash
4140
go test -v
4241
```

0 commit comments

Comments
 (0)