diff --git a/Containerfile b/Containerfile index b866f55b4..9c382250a 100644 --- a/Containerfile +++ b/Containerfile @@ -1,5 +1,6 @@ #syntax=docker/dockerfile-upstream:1.4.0-rc1 -FROM rust:1.65.0-buster as shuttle-build +ARG RUSTUP_TOOLCHAIN +FROM rust:${RUSTUP_TOOLCHAIN}-buster as shuttle-build RUN apt-get update &&\ apt-get install -y curl # download protoc binary and unzip it in usr/bin @@ -26,7 +27,8 @@ COPY --from=cache /build . ARG folder RUN cargo build --bin shuttle-${folder} -FROM rust:1.65.0-buster as shuttle-common +ARG RUSTUP_TOOLCHAIN +FROM rust:${RUSTUP_TOOLCHAIN}-buster as shuttle-common RUN apt-get update &&\ apt-get install -y curl RUN rustup component add rust-src @@ -37,4 +39,6 @@ ARG folder COPY ${folder}/prepare.sh /prepare.sh RUN /prepare.sh COPY --from=builder /build/target/debug/shuttle-${folder} /usr/local/bin/service +ARG RUSTUP_TOOLCHAIN +ENV RUSTUP_TOOLCHAIN=${RUSTUP_TOOLCHAIN} ENTRYPOINT ["/usr/local/bin/service"] diff --git a/Makefile b/Makefile index ee94af8f2..e57ba12b4 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,10 @@ endif BUILDX_FLAGS=$(BUILDX_OP) $(PLATFORM_FLAGS) $(CACHE_FLAGS) +# the rust version used by our containers, and as an override for our deployers +# ensuring all user crates are compiled with the same rustc toolchain +RUSTUP_TOOLCHAIN=1.65.0 + TAG?=$(shell git describe --tags) BACKEND_TAG?=$(TAG) DEPLOYER_TAG?=$(TAG) @@ -107,6 +111,7 @@ down: docker-compose.rendered.yml shuttle-%: ${SRC} Cargo.lock docker buildx build \ --build-arg folder=$(*) \ + --build-arg RUSTUP_TOOLCHAIN=$(RUSTUP_TOOLCHAIN) \ --tag $(CONTAINER_REGISTRY)/$(*):$(COMMIT_SHA) \ --tag $(CONTAINER_REGISTRY)/$(*):$(TAG) \ --tag $(CONTAINER_REGISTRY)/$(*):latest \ diff --git a/service/src/loader.rs b/service/src/loader.rs index faf8d1c42..11f6ffaf6 100644 --- a/service/src/loader.rs +++ b/service/src/loader.rs @@ -281,7 +281,7 @@ fn check_version(summary: &Summary) -> anyhow::Result<()> { { shuttle.version_req() } else { - return Err(anyhow!("this crate does not use the shutte service")); + return Err(anyhow!("this crate does not use the shuttle service")); }; if version_req.matches(&valid_version) {