File tree Expand file tree Collapse file tree 7 files changed +73
-22
lines changed Expand file tree Collapse file tree 7 files changed +73
-22
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,11 @@ ARG CARGO_DENY_VERSION=0.11.1
13
13
RUN curl --proto '=https' --tlsv1.3 -vsSfL "https://github.com/EmbarkStudios/cargo-deny/releases/download/${CARGO_DENY_VERSION}/cargo-deny-${CARGO_DENY_VERSION}-x86_64-unknown-linux-musl.tar.gz" \
14
14
| tar zvxf - --strip-components=1 -C /usr/local/bin "cargo-deny-${CARGO_DENY_VERSION}-x86_64-unknown-linux-musl/cargo-deny"
15
15
16
+ FROM docker.io/rust:${RUST_VERSION}-bullseye as yq
17
+ ARG YQ_VERSION=v4.2.0
18
+ RUN curl --proto '=https' --tlsv1.3 -vsSfLo /usr/local/bin/yq "https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64" \
19
+ && chmod +x /usr/local/bin/yq
20
+
16
21
#
17
22
# Main image
18
23
#
@@ -57,6 +62,7 @@ ENV PATH=$HOME/.linkerd2/bin:$PATH
57
62
COPY --from=cargo-deny /usr/local/bin/cargo-deny /usr/local/bin/cargo-deny
58
63
COPY --from=k3d /usr/local/bin/k3d /usr/local/bin/k3d
59
64
COPY --from=kubectl /usr/local/bin/kubectl /usr/local/bin/kubectl
65
+ COPY --from=yq /usr/local/bin/yq /usr/local/bin/yq
60
66
61
67
ENTRYPOINT ["/usr/local/share/docker-init.sh" ]
62
68
CMD ["sleep" , "infinity" ]
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " linkerd2-proxy" ,
3
- "image" : " ghcr.io/linkerd/dev-proxy:v6 " ,
3
+ "image" : " ghcr.io/linkerd/dev-proxy:v7 " ,
4
4
// "dockerFile": "./Dockerfile",
5
5
"extensions" : [
6
6
" matklad.rust-analyzer" ,
Original file line number Diff line number Diff line change 1
- ARG BASE_IMAGE=rust:1.56.1-buster
1
+ ARG RUST_VERSION=1.56.1
2
+ ARG BASE_IMAGE=rust:${RUST_VERSION}-buster
2
3
FROM $BASE_IMAGE
3
4
WORKDIR /linkerd
4
5
RUN apt-get update && \
Original file line number Diff line number Diff line change 18
18
- uses : actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
19
19
- run : docker build .devcontainer
20
20
21
- rust-version :
22
- runs-on : ubuntu-latest
23
- steps :
24
- - uses : actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
25
- - run : |
26
- versions=$(sed -nE 's|^ARG +RUST_VERSION=([^ #]+)|\1|p' .devcontainer/Dockerfile)
27
- ex=0
28
- if [ -z "$versions" ]; then
29
- echo "::error file=.devcontainer/Dockerfile::No Rust versions specified in Dockerfile"
30
- ex=1
31
- fi
32
- for mismatch in $(echo "$versions" | grep -vF "$(cat rust-toolchain)" || true) ; do
33
- echo "::error file=.devcontainer/Dockerfile::Devcontainer uses incorrect rust version(s): $mismatch"
34
- ex=$((ex + 1))
35
- done
36
- exit $ex
37
-
38
21
devcontainer-image :
39
22
runs-on : ubuntu-latest
40
23
steps :
Original file line number Diff line number Diff line change
1
+ name : rust-toolchain
2
+
3
+ on :
4
+ pull_request :
5
+ paths :
6
+ - rust-toolchain
7
+ - " **Dockerfile"
8
+ - " .github/workflows/*"
9
+ - " .github/**/Dockerfile"
10
+
11
+ permissions :
12
+ contents : read
13
+
14
+ env :
15
+ YQ_VERSION : v4.2.0
16
+
17
+ jobs :
18
+ dockerfiles :
19
+ runs-on : ubuntu-latest
20
+ steps :
21
+ - uses : actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
22
+ - run : |
23
+ VERSION="$(cat rust-toolchain)"
24
+ ex=0
25
+ for f in $(find . -name Dockerfile -and -not -path './.github/actions/release-tag-meta/*'); do
26
+ versions=$(sed -nE 's/^ARG RUST_VERSION=([^ ]+)/\1/p' $f)
27
+ if [ -z "$versions" ]; then
28
+ echo "::error file=$f::$f missing 'RUST_VERSION' argument"
29
+ ex=$((ex + 1))
30
+ fi
31
+ for mismatch in $(echo "$version" | grep -vF "$VERSION" || true) ; do
32
+ echo "::error file=$f::$f uses incorrect rust version(s): $mismatch"
33
+ ex=$((ex + 1))
34
+ done
35
+ done
36
+ exit $ex
37
+
38
+ workflows :
39
+ runs-on : ubuntu-latest
40
+ steps :
41
+ - uses : actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
42
+ - run : |
43
+ curl --proto '=https' --tlsv1.3 -vsSfLo /usr/local/bin/yq "https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64" \
44
+ && chmod +x /usr/local/bin/yq
45
+ - run : |
46
+ VERSION="$(cat rust-toolchain)"
47
+ ex=0
48
+ for f in $(find .github/workflows -name '*.yml') ; do
49
+ echo "# $f"
50
+ for image in $(yq eval '.jobs[].container.image' $f) ; do
51
+ if [[ "$image" =~ "^docker://(docker.io/library/)?rust:" ]]; then
52
+ v="${${image##*rust:}%%-*}"
53
+ if [[ "$v" != "$VERSION" ]]; then
54
+ echo "::warning file=$f::$f uses incorrect rust version: $v"
55
+ ex=$((ex + 1))
56
+ fi
57
+ fi
58
+ done
59
+ done
60
+ exit $ex
Original file line number Diff line number Diff line change 17
17
# :; docker buildx build . --load
18
18
19
19
# Please make changes via update-rust-version.sh
20
- ARG RUST_IMAGE=rust:1.56.1-buster
20
+ ARG RUST_VERSION=1.56.1
21
+ ARG RUST_IMAGE=rust:${RUST_VERSION}-buster
21
22
22
23
# Use an arbitrary ~recent edge release image to get the proxy
23
24
# identity-initializing and linkerd-await wrappers.
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ if ! echo "$VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$' ; then
14
14
fi
15
15
16
16
echo " $VERSION " > rust-toolchain
17
- find . -name Dockerfile\* \
18
- -exec sed -i' ' -Ee " s|rust: [0-9]+\.[0-9]+\.[0-9]+|rust: $VERSION |" ' {}' \;
17
+ find . -name Dockerfile \
18
+ -exec sed -i' ' -Ee " s|RUST_VERSION= [0-9]+\.[0-9]+\.[0-9]+|RUST_VERSION= $VERSION |" ' {}' \;
19
19
find .github -name \* .yml \
20
20
-exec sed -i' ' -Ee " s|rust:[0-9]+\.[0-9]+\.[0-9]+|rust:$VERSION |" ' {}' \;
You can’t perform that action at this time.
0 commit comments