Skip to content

Commit e80393c

Browse files
kpumukcodex
andcommitted
THRIFT-5000: Restore Docker Official Image packaging
Client: docker Co-Authored-By: OpenAI Codex (GPT-5.4) <codex@openai.com>
1 parent 3ac576c commit e80393c

16 files changed

Lines changed: 955 additions & 0 deletions

.github/workflows/docker.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Docker Official Image
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
paths:
7+
- 'docker/**'
8+
- '.github/workflows/docker.yml'
9+
- 'doc/ReleaseManagement.md'
10+
pull_request:
11+
paths:
12+
- 'docker/**'
13+
- '.github/workflows/docker.yml'
14+
- 'doc/ReleaseManagement.md'
15+
workflow_dispatch:
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
21+
permissions:
22+
contents: read
23+
24+
jobs:
25+
bashbrew:
26+
runs-on: ubuntu-22.04
27+
steps:
28+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
29+
30+
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c
31+
with:
32+
go-version: stable
33+
cache: false
34+
35+
- name: Install Bashbrew
36+
run: |
37+
set -eux
38+
GOBIN="$PWD/docker/tmp/bin" go install github.com/docker-library/bashbrew/cmd/bashbrew@v0.1.14
39+
echo "$PWD/docker/tmp/bin" >> "$GITHUB_PATH"
40+
41+
- name: Validate Bashbrew manifest
42+
run: |
43+
set -eux
44+
mkdir -p docker/tmp/bashbrew-library
45+
(cd docker && GIT_COMMIT="$(git rev-parse HEAD)" ./generate-stackbrew-library.sh) > docker/tmp/bashbrew-library/thrift
46+
BASHBREW_LIBRARY="$PWD/docker/tmp/bashbrew-library" bashbrew cat thrift >/dev/null
47+
BASHBREW_LIBRARY="$PWD/docker/tmp/bashbrew-library" bashbrew list --build-order --uniq thrift >/dev/null
48+
49+
docker:
50+
name: Docker (${{ matrix.platform }})
51+
runs-on: ${{ matrix.runner }}
52+
strategy:
53+
fail-fast: false
54+
matrix:
55+
include:
56+
- platform: linux/amd64
57+
runner: ubuntu-22.04
58+
- platform: linux/arm64
59+
runner: ubuntu-24.04-arm
60+
steps:
61+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
62+
63+
- name: Verify Docker Buildx
64+
run: docker buildx version
65+
66+
- name: Build and test Docker images
67+
timeout-minutes: 90
68+
run: docker/test.sh

doc/ReleaseManagement.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,20 @@ Voting on the development mailing list provides additional benefits (wisdom from
370370
371371
1. Update the web site content to include the new release. The repository is located at https://github.com/apache/thrift-website and there are plenty of instructions how to update both staging and live web site. With regard to the release, its actually quite simple: check out the main branch and edit two lines in _config.yml, then commit. The build bot will update staging. After checking everything is right, simply fast-forward "asf-site" to "asf-staging" and push, then production site will automatically get updated as well
372372
373+
1. Update the Docker Official Image packaging. Docker images are convenience artifacts built from the voted ASF source release; they are not ASF release artifacts and must not block the source release announcement if Docker Library review is delayed. Submit Docker updates only after the vote has passed, release artifacts have been promoted, and the web site/download page has been updated.
374+
375+
The Docker Official Image library tracks the two latest full Apache Thrift releases. Initial restored Docker image maintenance starts with the current release only; older releases are not backfilled. `latest` and unqualified OS aliases move according to the newest retained release and the explicit base metadata in `docker/versions.json`.
376+
377+
```bash
378+
thrift$ cd docker
379+
thrift/docker$ ./update.sh 1.0.0
380+
thrift/docker$ ./test.sh --all-platforms
381+
```
382+
383+
`update.sh` records archive.apache.org source URLs so retained Docker tags remain rebuildable; if the archive has not synced yet, wait and rerun it. Commit and push the Docker packaging update to Apache Thrift before generating the Docker Library manifest. Then run `./generate-official-images-library.sh /path/to/official-images/library/thrift` from `thrift/docker`; Docker Library manifests are generated artifacts and are not checked into this repository.
384+
385+
See [`docker/README.md`](../docker/README.md) for the detailed Docker Official Images workflow. Include Docker image availability in the announcement only if the Docker tags have already landed; otherwise follow up after Docker Official Images publishes them.
386+
373387
1. Make an announcement on the dev@ and user@ mailing lists of the release. There's no template to follow, but you can point folks to the official web site at https://thrift.apache.org, and to the GitHub site at https://github.org/apache.thrift.
374388

375389
### Post-Release

docker/.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tmp/

docker/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/tmp/

docker/0.22.0/Dockerfile

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
FROM debian:trixie AS builder
2+
3+
ARG THRIFT_VERSION=0.22.0
4+
ARG THRIFT_SOURCE_URL=https://archive.apache.org/dist/thrift/0.22.0/thrift-0.22.0.tar.gz
5+
ARG THRIFT_SOURCE_SHA256=794a0e455787960d9f27ab92c38e34da27e8deeda7a5db0e59dc64a00df8a1e5
6+
ARG THRIFT_SOURCE_SIGNER=8CD87F186F06E958EFCA963D76BD340FC4B75865
7+
8+
RUN set -eux; \
9+
apt-get update; \
10+
apt-get install -y --no-install-recommends \
11+
bison \
12+
ca-certificates \
13+
cmake \
14+
curl \
15+
flex \
16+
g++ \
17+
gnupg \
18+
make \
19+
; \
20+
rm -rf /var/lib/apt/lists/*
21+
22+
WORKDIR /usr/src
23+
24+
RUN set -eux; \
25+
curl -fsSL -o thrift.tar.gz "$THRIFT_SOURCE_URL"; \
26+
curl -fsSL -o thrift.tar.gz.asc "$THRIFT_SOURCE_URL.asc"; \
27+
curl -fsSL -o thrift-KEYS https://downloads.apache.org/thrift/KEYS; \
28+
echo "$THRIFT_SOURCE_SHA256 *thrift.tar.gz" | sha256sum -c -; \
29+
export GNUPGHOME="$(mktemp -d)"; \
30+
gpg --batch --import thrift-KEYS; \
31+
gpg --batch --status-fd 1 --verify thrift.tar.gz.asc thrift.tar.gz > gpg.status; \
32+
grep -F "[GNUPG:] VALIDSIG $THRIFT_SOURCE_SIGNER " gpg.status; \
33+
gpgconf --kill all; \
34+
rm -rf "$GNUPGHOME"; \
35+
mkdir thrift; \
36+
tar -xzf thrift.tar.gz -C thrift --strip-components=1; \
37+
rm thrift.tar.gz thrift.tar.gz.asc thrift-KEYS gpg.status
38+
39+
RUN set -eux; \
40+
cmake -S thrift -B build \
41+
-DCMAKE_BUILD_TYPE=Release \
42+
-DBUILD_COMPILER=ON \
43+
-DBUILD_LIBRARIES=OFF \
44+
-DBUILD_TESTING=OFF \
45+
-DBUILD_TUTORIALS=OFF; \
46+
cmake --build build --target thrift-compiler -j "$(nproc)"; \
47+
cmake --install build --prefix /opt/thrift
48+
49+
FROM debian:trixie-slim
50+
51+
ARG THRIFT_VERSION=0.22.0
52+
53+
LABEL org.opencontainers.image.title="Apache Thrift Compiler" \
54+
org.opencontainers.image.version="$THRIFT_VERSION" \
55+
org.opencontainers.image.source="https://github.com/apache/thrift" \
56+
org.opencontainers.image.url="https://thrift.apache.org/" \
57+
org.opencontainers.image.licenses="Apache-2.0"
58+
59+
RUN set -eux; \
60+
apt-get update; \
61+
apt-get install -y --no-install-recommends libstdc++6; \
62+
rm -rf /var/lib/apt/lists/*
63+
64+
COPY --from=builder /opt/thrift/bin/thrift /usr/local/bin/thrift
65+
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
66+
COPY tests/smoke.thrift /tmp/smoke.thrift
67+
68+
RUN set -eux; \
69+
thrift --version | grep -F "$THRIFT_VERSION"; \
70+
mkdir -p /tmp/smoke-out; \
71+
thrift --gen json -o /tmp/smoke-out /tmp/smoke.thrift; \
72+
find /tmp/smoke-out -type f | grep -q .; \
73+
rm -rf /tmp/smoke.thrift /tmp/smoke-out
74+
75+
WORKDIR /data
76+
77+
ENTRYPOINT ["docker-entrypoint.sh"]
78+
CMD ["thrift"]

docker/0.22.0/Dockerfile.alpine

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
FROM alpine:3.23 AS builder
2+
3+
ARG THRIFT_VERSION=0.22.0
4+
ARG THRIFT_SOURCE_URL=https://archive.apache.org/dist/thrift/0.22.0/thrift-0.22.0.tar.gz
5+
ARG THRIFT_SOURCE_SHA256=794a0e455787960d9f27ab92c38e34da27e8deeda7a5db0e59dc64a00df8a1e5
6+
ARG THRIFT_SOURCE_SIGNER=8CD87F186F06E958EFCA963D76BD340FC4B75865
7+
8+
RUN set -eux; \
9+
apk add --no-cache \
10+
bison \
11+
build-base \
12+
ca-certificates \
13+
cmake \
14+
curl \
15+
flex \
16+
gnupg \
17+
; \
18+
update-ca-certificates
19+
20+
WORKDIR /usr/src
21+
22+
RUN set -eux; \
23+
curl -fsSL -o thrift.tar.gz "$THRIFT_SOURCE_URL"; \
24+
curl -fsSL -o thrift.tar.gz.asc "$THRIFT_SOURCE_URL.asc"; \
25+
curl -fsSL -o thrift-KEYS https://downloads.apache.org/thrift/KEYS; \
26+
echo "$THRIFT_SOURCE_SHA256 *thrift.tar.gz" | sha256sum -c -; \
27+
export GNUPGHOME="$(mktemp -d)"; \
28+
gpg --batch --import thrift-KEYS; \
29+
gpg --batch --status-fd 1 --verify thrift.tar.gz.asc thrift.tar.gz > gpg.status; \
30+
grep -F "[GNUPG:] VALIDSIG $THRIFT_SOURCE_SIGNER " gpg.status; \
31+
gpgconf --kill all; \
32+
rm -rf "$GNUPGHOME"; \
33+
mkdir thrift; \
34+
tar -xzf thrift.tar.gz -C thrift --strip-components=1; \
35+
rm thrift.tar.gz thrift.tar.gz.asc thrift-KEYS gpg.status
36+
37+
RUN set -eux; \
38+
cmake -S thrift -B build \
39+
-DCMAKE_BUILD_TYPE=Release \
40+
-DBUILD_COMPILER=ON \
41+
-DBUILD_LIBRARIES=OFF \
42+
-DBUILD_TESTING=OFF \
43+
-DBUILD_TUTORIALS=OFF; \
44+
cmake --build build --target thrift-compiler -j "$(nproc)"; \
45+
cmake --install build --prefix /opt/thrift
46+
47+
FROM alpine:3.23
48+
49+
ARG THRIFT_VERSION=0.22.0
50+
51+
LABEL org.opencontainers.image.title="Apache Thrift Compiler" \
52+
org.opencontainers.image.version="$THRIFT_VERSION" \
53+
org.opencontainers.image.source="https://github.com/apache/thrift" \
54+
org.opencontainers.image.url="https://thrift.apache.org/" \
55+
org.opencontainers.image.licenses="Apache-2.0"
56+
57+
RUN set -eux; \
58+
apk add --no-cache libstdc++
59+
60+
COPY --from=builder /opt/thrift/bin/thrift /usr/local/bin/thrift
61+
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
62+
COPY tests/smoke.thrift /tmp/smoke.thrift
63+
64+
RUN set -eux; \
65+
thrift --version | grep -F "$THRIFT_VERSION"; \
66+
mkdir -p /tmp/smoke-out; \
67+
thrift --gen json -o /tmp/smoke-out /tmp/smoke.thrift; \
68+
find /tmp/smoke-out -type f | grep -q .; \
69+
rm -rf /tmp/smoke.thrift /tmp/smoke-out
70+
71+
WORKDIR /data
72+
73+
ENTRYPOINT ["docker-entrypoint.sh"]
74+
CMD ["thrift"]

docker/0.23.0/Dockerfile

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
FROM debian:trixie AS builder
2+
3+
ARG THRIFT_VERSION=0.23.0
4+
ARG THRIFT_SOURCE_URL=https://archive.apache.org/dist/thrift/0.23.0/thrift-0.23.0.tar.gz
5+
ARG THRIFT_SOURCE_SHA256=1859d932d2ae1f13d16c5a196931208c116310a5ff50f2bfd11d3db03be8f46f
6+
ARG THRIFT_SOURCE_SIGNER=8CD87F186F06E958EFCA963D76BD340FC4B75865
7+
8+
RUN set -eux; \
9+
apt-get update; \
10+
apt-get install -y --no-install-recommends \
11+
bison \
12+
ca-certificates \
13+
cmake \
14+
curl \
15+
flex \
16+
g++ \
17+
gnupg \
18+
make \
19+
; \
20+
rm -rf /var/lib/apt/lists/*
21+
22+
WORKDIR /usr/src
23+
24+
RUN set -eux; \
25+
curl -fsSL -o thrift.tar.gz "$THRIFT_SOURCE_URL"; \
26+
curl -fsSL -o thrift.tar.gz.asc "$THRIFT_SOURCE_URL.asc"; \
27+
curl -fsSL -o thrift-KEYS https://downloads.apache.org/thrift/KEYS; \
28+
echo "$THRIFT_SOURCE_SHA256 *thrift.tar.gz" | sha256sum -c -; \
29+
export GNUPGHOME="$(mktemp -d)"; \
30+
gpg --batch --import thrift-KEYS; \
31+
gpg --batch --status-fd 1 --verify thrift.tar.gz.asc thrift.tar.gz > gpg.status; \
32+
grep -F "[GNUPG:] VALIDSIG $THRIFT_SOURCE_SIGNER " gpg.status; \
33+
gpgconf --kill all; \
34+
rm -rf "$GNUPGHOME"; \
35+
mkdir thrift; \
36+
tar -xzf thrift.tar.gz -C thrift --strip-components=1; \
37+
rm thrift.tar.gz thrift.tar.gz.asc thrift-KEYS gpg.status
38+
39+
RUN set -eux; \
40+
cmake -S thrift -B build \
41+
-DCMAKE_BUILD_TYPE=Release \
42+
-DBUILD_COMPILER=ON \
43+
-DBUILD_LIBRARIES=OFF \
44+
-DBUILD_TESTING=OFF \
45+
-DBUILD_TUTORIALS=OFF; \
46+
cmake --build build --target thrift-compiler -j "$(nproc)"; \
47+
cmake --install build --prefix /opt/thrift
48+
49+
FROM debian:trixie-slim
50+
51+
ARG THRIFT_VERSION=0.23.0
52+
53+
LABEL org.opencontainers.image.title="Apache Thrift Compiler" \
54+
org.opencontainers.image.version="$THRIFT_VERSION" \
55+
org.opencontainers.image.source="https://github.com/apache/thrift" \
56+
org.opencontainers.image.url="https://thrift.apache.org/" \
57+
org.opencontainers.image.licenses="Apache-2.0"
58+
59+
RUN set -eux; \
60+
apt-get update; \
61+
apt-get install -y --no-install-recommends libstdc++6; \
62+
rm -rf /var/lib/apt/lists/*
63+
64+
COPY --from=builder /opt/thrift/bin/thrift /usr/local/bin/thrift
65+
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
66+
COPY tests/smoke.thrift /tmp/smoke.thrift
67+
68+
RUN set -eux; \
69+
thrift --version | grep -F "$THRIFT_VERSION"; \
70+
mkdir -p /tmp/smoke-out; \
71+
thrift --gen json -o /tmp/smoke-out /tmp/smoke.thrift; \
72+
find /tmp/smoke-out -type f | grep -q .; \
73+
rm -rf /tmp/smoke.thrift /tmp/smoke-out
74+
75+
WORKDIR /data
76+
77+
ENTRYPOINT ["docker-entrypoint.sh"]
78+
CMD ["thrift"]

0 commit comments

Comments
 (0)