Skip to content

Commit f2d0d33

Browse files
adoroszlaijojochuang
authored andcommitted
HDDS-11916. Building Ozone Docker Images (apache#126)
1 parent c7cb7a0 commit f2d0d33

1 file changed

Lines changed: 103 additions & 4 deletions

File tree

docs/08-developer-guide/01-build/03-docker-images.md

Lines changed: 103 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,109 @@
22
sidebar_label: Docker Images
33
---
44

5+
<!-- cspell:word testkrb5 -->
6+
57
# Building Ozone Docker Images
68

7-
**TODO:** File a subtask under [HDDS-9861](https://issues.apache.org/jira/browse/HDDS-9861) and complete this page or section.
9+
This page provides an overview of the Docker images maintained by the Apache Ozone community for developing and testing Ozone. It also describes the workflow to be followed when making changes to one of these images.
10+
11+
## ozone-runner
12+
13+
[ozone-runner](https://github.com/apache/ozone-docker-runner) is the base image with tools for running and testing Ozone, but does not include any Ozone artifacts.
14+
15+
Developers and CI workflows rely on it heavily to run/test custom Ozone builds (using the local build via bind-mount). It also serves as the base image for `apache/ozone` (see next section).
16+
17+
Published to [Docker Hub](https://hub.docker.com/r/apache/ozone-runner) and [GitHub](https://github.com/apache/ozone-docker-runner/pkgs/container/ozone-runner).
18+
19+
Development happens on branch `master`, relevant changes are cherry-picked to branch `jdk11`.
20+
21+
### Building
22+
23+
The image can be built simply by running the helper script `build.sh`:
24+
25+
```bash
26+
./build.sh
27+
```
28+
29+
### Tagging
30+
31+
Images are tagged by date, and come in two flavors: `jdk21` (for Ozone 2.0+) and `jdk11` (for Ozone 1.x).
32+
33+
Publishing Docker tags:
34+
35+
1. Add a Git tag for the commit following the existing pattern (`<date>-<n>-<flavor>`, where `<n>` starts at 1, and is incremented if multiple images need to be published the same day).
36+
2. Push the Git tag to the origin repo (`apache/ozone-docker-testkrb5`). This will trigger a workflow run to apply the tag to the Docker image.
37+
38+
## ozone
39+
40+
[ozone](https://github.com/apache/ozone-docker) is built on top of `ozone-runner`, adding the binaries built for official Ozone releases.
41+
42+
These are used for testing compatibility of various Ozone versions, and upgrade from one version to another. May also be useful for running quick experiments with specific version of Ozone, without the need to download or rebuild it.
43+
44+
Published to [Docker Hub](https://hub.docker.com/r/apache/ozone) and [GitHub](https://github.com/apache/ozone-docker/pkgs/container/ozone).
45+
46+
Development branch: `latest`.
47+
48+
### Building
49+
50+
The image can be built simply by running the helper script `build.sh`:
51+
52+
```bash
53+
./build.sh
54+
```
55+
56+
This will create a single-platform image for your architecture. Build automation in GitHub Actions creates multi-platform image for `amd64` and `arm64`.
57+
58+
It can be customized via environment variables defined at build time.
59+
60+
```bash
61+
# the URL to download Ozone from; allows using custom tarball or local mirror
62+
OZONE_URL
63+
64+
# version of Ozone to include in the image; ignored if URL is also specified
65+
OZONE_VERSION
66+
67+
# the base image name in repo/image format
68+
OZONE_RUNNER_IMAGE
69+
70+
# the base image version to use
71+
OZONE_RUNNER_VERSION
72+
```
73+
74+
### Tagging
75+
76+
Images are tagged by Ozone version numbers and optional flavor. Flavor `-rocky` was introduced when `ozone-runner` was changed from CentOS to Rocky Linux due to CentOS end-of-life, to avoid breaking things for existing users. Future images will be published only with Rocky Linux, with and without flavor suffix.
77+
78+
Image tags are derived from branch names: push to the branch `ozone-<tag>` gets published with `<tag>` (e.g. `ozone-1.4.1 -> 1.4.1`).
79+
80+
Publishing Docker tags:
81+
82+
1. Update the version-specific branch:
83+
- The latest release version can usually be updated by fast-forwarding the branch: `git merge --ff-only origin/latest`. This allows CI workflow to tag the existing image from `latest` branch, instead of building completely new image.
84+
- For other versions branch can be updated by cherry-picking one or more commits.
85+
2. Push the branch to the origin repo (`apache/ozone-docker`). This will trigger a workflow run to publish the image.
86+
87+
## ozone-testkrb5
88+
89+
[ozone-testkrb5](https://github.com/apache/ozone-docker-testkrb5) is used as KDC in tests where Kerberos is enabled.
90+
91+
Published only to [GitHub](https://github.com/apache/ozone-docker-testkrb5/pkgs/container/ozone-testkrb5), because it is completely insecure, and should be used only for testing.
92+
93+
Development branch: `master`.
94+
95+
### Building
96+
97+
The image can be built simply by running the helper script `build.sh`:
98+
99+
```bash
100+
./build.sh
101+
```
102+
103+
### Tagging
104+
105+
Images are tagged by date.
106+
107+
Publishing Docker tags:
8108

9-
- Point to the `ozone-docker` repo and define its purpose as a testing/demo image with Ozone binaries included.
10-
- Point to the `ozone-docker-runner` repo and define its purpose as a test image where Ozone binaries can be mounted.
11-
- Instructions for building the images from source, customizing architecture (arm).
109+
1. Add a Git tag for the commit following existing pattern (`<date>-<n>`, where `<n>` starts at 1, and is incremented if multiple images need to be published the same day).
110+
2. Push the Git tag to the origin repo (`apache/ozone-docker-testkrb5`). This will trigger a workflow run to apply the tag to the Docker image.

0 commit comments

Comments
 (0)