Skip to content

Commit d343738

Browse files
Transition to Native Multi-Platform Builds for Docker Images (drasi-project#161)
* Update Rust Image version to 1.84 * Rewrite Release WF to use ARM runner * update actions/cache to v4.2.1
1 parent 9cc417b commit d343738

File tree

14 files changed

+418
-321
lines changed

14 files changed

+418
-321
lines changed

.github/workflows/build-test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ jobs:
349349
go-version: '1.21'
350350

351351
- name: Cache Go modules
352-
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
352+
uses: actions/cache@v4
353353
with:
354354
path: |
355355
~/go/pkg/mod

.github/workflows/draft-release.yml

+351-234
Large diffs are not rendered by default.
+16-18
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
# Copyright 2024 The Drasi Authors.
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
14-
15-
FROM rust@sha256:8fae3b1a63a4dcfb6cf277a49fb5967ccbf479b9e9cee4588a077a9cb216e6d4 as builder
16-
# rust:1.81-bullseye
1+
# Copyright 2024 The Drasi Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
FROM rust:1.84-bullseye as builder
1716
RUN apt-get update && apt-get install -y protobuf-compiler cmake libc6-dev libssl-dev libclang-dev
1817

1918
WORKDIR /usr/src
@@ -26,7 +25,6 @@ RUN cargo fetch
2625
COPY ./kubernetes_provider .
2726
RUN cargo install --force --path .
2827

29-
FROM gcr.io/distroless/cc-debian11@sha256:55a5e011b2c4246b4c51e01fcc2b452d151e03df052e357465f0392fcd59fddf
30-
# gcr.io/distroless/cc-debian11
28+
FROM gcr.io/distroless/cc-debian11
3129
COPY --from=builder /usr/local/cargo/bin/kubernetes_provider /usr/local/bin/kubernetes_provider
3230
CMD ["kubernetes_provider"]

control-planes/mgmt_api/Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ RUN cargo fetch
2626
COPY ./control-planes/mgmt_api .
2727
RUN cargo install --force --path .
2828

29-
FROM gcr.io/distroless/cc-debian11@sha256:55a5e011b2c4246b4c51e01fcc2b452d151e03df052e357465f0392fcd59fddf
30-
# gcr.io/distroless/cc-debian11
29+
FROM gcr.io/distroless/cc-debian11
3130
COPY --from=builder /usr/local/cargo/bin/mgmt_api /usr/local/bin/mgmt_api
3231
CMD ["mgmt_api"]

query-container/publish-api/Dockerfile

+2-3
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@
1313
# limitations under the License.
1414

1515
FROM rust:1.84-bullseye as builder
16-
RUN apt-get update && apt-get install -y protobuf-compiler cmake libc6-dev libssl-dev libclang-dev
16+
RUN apt-get update && apt-get install -y protobuf-compiler cmake libc6-dev libssl-dev libclang-dev libcurl4 && apt-get clean
1717

1818
WORKDIR /usr/src
1919
COPY . .
2020
WORKDIR /usr/src
2121
RUN cargo install --force --path .
2222

23-
FROM gcr.io/distroless/cc-debian11@sha256:55a5e011b2c4246b4c51e01fcc2b452d151e03df052e357465f0392fcd59fddf
24-
# gcr.io/distroless/cc-debian11
23+
FROM gcr.io/distroless/cc-debian11
2524
ENV RUST_BACKTRACE=1
2625
COPY --from=builder /usr/local/cargo/bin/publish-api /usr/local/bin/publish-api
2726
CMD ["publish-api"]

query-container/query-host/Dockerfile

+11-13
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,15 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM rust@sha256:8fae3b1a63a4dcfb6cf277a49fb5967ccbf479b9e9cee4588a077a9cb216e6d4 as builder
16-
# rust:1.81-bullseye
17-
RUN apt-get update && apt-get install -y protobuf-compiler cmake libc6-dev libssl-dev libclang-dev
18-
19-
WORKDIR /usr/src
20-
COPY . .
21-
WORKDIR /usr/src
22-
RUN cargo install --path .
23-
24-
FROM gcr.io/distroless/cc-debian11@sha256:55a5e011b2c4246b4c51e01fcc2b452d151e03df052e357465f0392fcd59fddf
25-
# gcr.io/distroless/cc-debian11
26-
ENV RUST_BACKTRACE=1
27-
COPY --from=builder /usr/local/cargo/bin/query-host /usr/local/bin/query-host
15+
FROM rust:1.84-bullseye as builder
16+
RUN apt-get update && apt-get install -y protobuf-compiler cmake libc6-dev libssl-dev libclang-dev
17+
18+
WORKDIR /usr/src
19+
COPY . .
20+
WORKDIR /usr/src
21+
RUN cargo install --path .
22+
23+
FROM gcr.io/distroless/cc-debian11
24+
ENV RUST_BACKTRACE=1
25+
COPY --from=builder /usr/local/cargo/bin/query-host /usr/local/bin/query-host
2826
CMD ["query-host"]

query-container/view-svc/Dockerfile

+11-13
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,15 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM rust@sha256:8fae3b1a63a4dcfb6cf277a49fb5967ccbf479b9e9cee4588a077a9cb216e6d4 as builder
16-
# rust:1.81-bullseye
17-
RUN apt-get update && apt-get install -y protobuf-compiler cmake libc6-dev libssl-dev libclang-dev
18-
19-
WORKDIR /usr/src
20-
COPY . .
21-
WORKDIR /usr/src
22-
RUN cargo install --force --path .
23-
24-
FROM gcr.io/distroless/cc@sha256:3b75fdd33932d16e53a461277becf57c4f815c6cee5f6bc8f52457c095e004c8
25-
# gcr.io/distroless/cc
26-
ENV RUST_BACKTRACE=1
27-
COPY --from=builder /usr/local/cargo/bin/view-svc /usr/local/bin/view-svc
15+
FROM rust:1.84-bullseye as builder
16+
RUN apt-get update && apt-get install -y protobuf-compiler cmake libc6-dev libssl-dev libclang-dev
17+
18+
WORKDIR /usr/src
19+
COPY . .
20+
WORKDIR /usr/src
21+
RUN cargo install --force --path .
22+
23+
FROM gcr.io/distroless/cc-debian11
24+
ENV RUST_BACKTRACE=1
25+
COPY --from=builder /usr/local/cargo/bin/view-svc /usr/local/bin/view-svc
2826
CMD ["view-svc"]
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
FROM rust@sha256:8fae3b1a63a4dcfb6cf277a49fb5967ccbf479b9e9cee4588a077a9cb216e6d4 as builder
2-
# rust:1.81-bullseye
1+
FROM rust:1.84-bullseye as builder
32
RUN apt-get update && apt-get install -y protobuf-compiler libcurl4 && apt-get clean
43

54
WORKDIR /usr/src
65
COPY . .
76
WORKDIR /usr/src
87
RUN cargo install --force --path .
98

10-
FROM gcr.io/distroless/cc-debian11@sha256:55a5e011b2c4246b4c51e01fcc2b452d151e03df052e357465f0392fcd59fddf
11-
# gcr.io/distroless/cc-debian11
9+
FROM gcr.io/distroless/cc-debian11
1210
ENV RUST_BACKTRACE=1
1311
COPY --from=builder /usr/local/cargo/bin/kubernetes-proxy /usr/local/bin/kubernetes-proxy
1412
CMD ["kubernetes-proxy"]
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
FROM rust@sha256:8fae3b1a63a4dcfb6cf277a49fb5967ccbf479b9e9cee4588a077a9cb216e6d4 as builder
2-
# rust:1.81-bullseye
1+
FROM rust:1.84-bullseye as builder
32
RUN apt-get update && apt-get install -y protobuf-compiler libcurl4 && apt-get clean
43

54
WORKDIR /usr/src
65
COPY . .
76
WORKDIR /usr/src
87
RUN cargo install --force --path .
98

10-
FROM gcr.io/distroless/cc-debian11@sha256:55a5e011b2c4246b4c51e01fcc2b452d151e03df052e357465f0392fcd59fddf
11-
# gcr.io/distroless/cc-debian11
9+
FROM gcr.io/distroless/cc-debian11
1210
ENV RUST_BACKTRACE=1
1311
COPY --from=builder /usr/local/cargo/bin/kubernetes-reactivator /usr/local/bin/kubernetes-reactivator
1412
CMD ["kubernetes-reactivator"]
+2-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
FROM rust@sha256:8fae3b1a63a4dcfb6cf277a49fb5967ccbf479b9e9cee4588a077a9cb216e6d4 as builder
2-
# rust:1.81-bullseye
1+
FROM rust:1.84-bullseye as builder
32
RUN apt-get update && apt-get install -y protobuf-compiler libcurl4 && apt-get clean
43

54
WORKDIR /usr/src
65
COPY . .
76
WORKDIR /usr/src
87
RUN cargo install --force --path .
98

10-
FROM gcr.io/distroless/cc-debian11@sha256:55a5e011b2c4246b4c51e01fcc2b452d151e03df052e357465f0392fcd59fddf
11-
# gcr.io/distroless/cc-debian11
9+
FROM gcr.io/distroless/cc-debian11
1210
ENV RUST_BACKTRACE=1
1311
COPY --from=builder /usr/local/cargo/bin/proxy /usr/local/bin/proxy
1412
CMD ["proxy"]
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
FROM rust@sha256:8fae3b1a63a4dcfb6cf277a49fb5967ccbf479b9e9cee4588a077a9cb216e6d4 as builder
2-
# rust:1.81-bullseye
1+
FROM rust:1.84-bullseye as builder
32
RUN apt-get update && apt-get install -y protobuf-compiler libcurl4 && apt-get clean
43

54
WORKDIR /usr/src
65
COPY . .
76
WORKDIR /usr/src
87
RUN cargo install --force --path .
98

10-
FROM gcr.io/distroless/cc-debian11@sha256:55a5e011b2c4246b4c51e01fcc2b452d151e03df052e357465f0392fcd59fddf
11-
# gcr.io/distroless/cc-debian11
9+
FROM gcr.io/distroless/cc-debian11
1210
ENV RUST_BACKTRACE=1
1311
COPY --from=builder /usr/local/cargo/bin/reactivator /usr/local/bin/reactivator
1412
CMD ["reactivator"]

sources/shared/change-dispatcher/Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ COPY ./sources/shared/change-dispatcher .
2626
RUN cargo install --force --path .
2727

2828

29-
FROM gcr.io/distroless/cc-debian11@sha256:55a5e011b2c4246b4c51e01fcc2b452d151e03df052e357465f0392fcd59fddf
30-
# gcr.io/distroless/cc-debian11
29+
FROM gcr.io/distroless/cc-debian11
3130
ENV RUST_BACKTRACE=1
3231
COPY --from=builder /usr/local/cargo/bin/change-dispatcher /usr/local/bin/change-dispatcher
3332
# RUN apt-get update && apt install -y openssl

sources/shared/change-router/Dockerfile

+15-17
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1-
# Copyright 2024 The Drasi Authors.
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
14-
15-
FROM rust@sha256:8fae3b1a63a4dcfb6cf277a49fb5967ccbf479b9e9cee4588a077a9cb216e6d4 as builder
16-
# rust:1.81-bullseye
1+
# Copyright 2024 The Drasi Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
1714

15+
FROM rust:1.84-bullseye as builder
1816
RUN apt-get update && apt-get install -y protobuf-compiler libcurl4 && apt-get clean
1917

2018
WORKDIR /usr/src
@@ -28,7 +26,7 @@ COPY ./sources/shared/change-router .
2826
RUN cargo install --force --path .
2927

3028

31-
FROM gcr.io/distroless/cc-debian11@sha256:55a5e011b2c4246b4c51e01fcc2b452d151e03df052e357465f0392fcd59fddf
29+
FROM gcr.io/distroless/cc-debian11
3230
ENV RUST_BACKTRACE=1
3331
# RUN apt-get update && apt-get install -y protobuf-compiler libcurl4 && rm -rf /var/lib/apt/lists/*
3432
COPY --from=builder /usr/local/cargo/bin/change-router /usr/local/bin/change-router

sources/shared/query-api/Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ COPY ./sources/shared/query-api .
2626
RUN cargo install --force --path .
2727

2828

29-
FROM gcr.io/distroless/cc-debian11@sha256:55a5e011b2c4246b4c51e01fcc2b452d151e03df052e357465f0392fcd59fddf
30-
# gcr.io/distroless/cc-debian11
29+
FROM gcr.io/distroless/cc-debian11
3130
ENV RUST_BACKTRACE=1
3231
COPY --from=builder /usr/local/cargo/bin/query-api /usr/local/bin/query-api
3332
# RUN apt-get update && apt install -y openssl

0 commit comments

Comments
 (0)