Note
|
All of this work is experimental and subject to change or removal. |
-
Install docker following the instructions here
Note
|
These sample commands assume running from the project root directory. |
Build all the images for the default OS:
$ ./docker/docker-build.sh
Run an image with a bash prompt and remove it on exit:
$ docker run -it --rm apache/kudu:latest /bin/bash
It could be useful to copy files from a pre-built container to your host. For example, pre-built thirdparty or kudu binaries.
$ SOURCE=`docker create kudu:thirdparty-xenial-latest`
$ docker cp $SOURCE:/kudu/thirdparty /local/kudu/thirdparty
A runtime image with the Kudu binaries and clients pre-installed and an entrypoint script that enables easily starting Kudu masters and tservers along with executing other commands. Copies the built artifacts and files from the kudu-build image.
An image that has the Kudu source code pre-built. Uses the kudu-thirdparty image as a base.
An image that has Kudu’s thirdparty dependencies built. Uses the kudu-base image as a base.
If your docker build fails with an unusual or unclear error a good first step is to ensure docker has enough resources. A good place to start is 4 CPUs, 4 GiB of memory, and 32 GiB of disk.
If you don’t clean up your environment periodically, you will likely run out of disk space. Use the following commands clean up after builds.
Clean all stopped containers, all dangling images, all dangling build cache and all unused networks:
$ docker system prune
Remove all stopped containers:
$ docker container prune
Remove all dangling images:
$ docker image prune
Remove all Kudu images :
$ docker rmi -f $(docker images -q apache/kudu)
Remove specific images:
$ docker rmi [IMAGE...]
Remove images by tag pattern:
$ TAG_PATTERN="apache/kudu:*"
$ docker rmi $(docker images -q "$TAG_PATTERN" --format "{{.Repository}}:{{.Tag}}")
You can tell docker to considered remote or local images in your build as cache sources. This can be especially useful when the base or thirdparty images have not changed as those builds can take a very long time.
To do this use the --cache-from
flag when executing docker build
commands.
The docker builds can take a long time to run. During that
time you may want to continue other work in the git repo. Use
git worktree
to specify a worktree in another directory and
run the docker build from there. Read more about git worktree
here.