File tree Expand file tree Collapse file tree 4 files changed +14
-11
lines changed Expand file tree Collapse file tree 4 files changed +14
-11
lines changed Original file line number Diff line number Diff line change 1
1
# syntax=docker/dockerfile-upstream:1.4.0-rc1
2
- FROM rust:1.65.0-buster as shuttle-build
2
+ ARG RUSTUP_TOOLCHAIN
3
+ FROM rust:${RUSTUP_TOOLCHAIN}-buster as shuttle-build
3
4
RUN apt-get update &&\
4
5
apt-get install -y curl
5
6
# download protoc binary and unzip it in usr/bin
@@ -26,7 +27,8 @@ COPY --from=cache /build .
26
27
ARG folder
27
28
RUN cargo build --bin shuttle-${folder}
28
29
29
- FROM rust:1.65.0-buster as shuttle-common
30
+ ARG RUSTUP_TOOLCHAIN
31
+ FROM rust:${RUSTUP_TOOLCHAIN}-buster as shuttle-common
30
32
RUN apt-get update &&\
31
33
apt-get install -y curl
32
34
RUN rustup component add rust-src
@@ -37,4 +39,6 @@ ARG folder
37
39
COPY ${folder}/prepare.sh /prepare.sh
38
40
RUN /prepare.sh
39
41
COPY --from=builder /build/target/debug/shuttle-${folder} /usr/local/bin/service
42
+ ARG RUSTUP_TOOLCHAIN
43
+ ENV RUSTUP_TOOLCHAIN=${RUSTUP_TOOLCHAIN}
40
44
ENTRYPOINT ["/usr/local/bin/service" ]
Original file line number Diff line number Diff line change 20
20
21
21
BUILDX_FLAGS =$(BUILDX_OP ) $(PLATFORM_FLAGS ) $(CACHE_FLAGS )
22
22
23
+ # the rust version used by our containers
24
+ RUSTUP_TOOLCHAIN =1.65.0
25
+
23
26
TAG? =$(shell git describe --tags)
24
27
BACKEND_TAG? =$(TAG )
25
28
DEPLOYER_TAG? =$(TAG )
@@ -107,6 +110,7 @@ down: docker-compose.rendered.yml
107
110
shuttle-% : ${SRC} Cargo.lock
108
111
docker buildx build \
109
112
--build-arg folder=$(* ) \
113
+ --build-arg RUSTUP_TOOLCHAIN=$(RUSTUP_TOOLCHAIN ) \
110
114
--tag $(CONTAINER_REGISTRY ) /$(* ) :$(COMMIT_SHA ) \
111
115
--tag $(CONTAINER_REGISTRY ) /$(* ) :$(TAG ) \
112
116
--tag $(CONTAINER_REGISTRY ) /$(* ) :latest \
Original file line number Diff line number Diff line change @@ -481,13 +481,8 @@ impl ProjectCreating {
481
481
name : self . container_name ( ctx) ,
482
482
} ;
483
483
484
- // Get the version of rustc gateway was compiled with, matching the deployer
485
- // RUSTUP_TOOLCHAIN override with the version from our Containerfile
486
- let rustc_version = rustc_version_runtime:: version ( ) . to_string ( ) ;
487
- debug ! (
488
- "got installed rustc version for deployer toolchain override: {}" ,
489
- rustc_version
490
- ) ;
484
+ let rustup_toolchain =
485
+ std:: env:: var ( "RUSTUP_TOOLCHAIN" ) . expect ( "rustup toolchain should be set" ) ;
491
486
492
487
let container_config = self
493
488
. from
@@ -525,7 +520,7 @@ impl ProjectCreating {
525
520
"RUST_LOG=debug" ,
526
521
// If we don't set this, users' dependencies with a `rust-toolchain.toml`
527
522
// override will compile with incompatible versions of rust.
528
- format!( "RUSTUP_TOOLCHAIN={rustc_version }" )
523
+ format!( "RUSTUP_TOOLCHAIN={rustup_toolchain }" )
529
524
]
530
525
} )
531
526
} ) ;
You can’t perform that action at this time.
0 commit comments