Update rust version in docker image

This commit is contained in:
Jianfeng Jiang 2023-08-07 11:35:01 +08:00 committed by Tate, Hongliang Tian
parent 2e7fd91264
commit 04db7c8c3d
2 changed files with 9 additions and 3 deletions

View File

@ -44,7 +44,7 @@ RUN apt clean \
# Install Rust
ENV PATH="/root/.cargo/bin:${PATH}"
ENV JINUX_RUST_VERSION="nightly-2023-02-05"
ARG JINUX_RUST_VERSION
RUN curl https://sh.rustup.rs -sSf | \
sh -s -- --default-toolchain ${JINUX_RUST_VERSION} -y \
&& rm -rf /root/.cargo/registry && rm -rf /root/.cargo/git \
@ -60,7 +60,8 @@ ENV PATH="/root/jinux/target/bin:${PATH}"
# Build busybox
RUN curl --output busybox.tar.bz2 https://busybox.net/downloads/busybox-1.35.0.tar.bz2 \
&& mkdir /root/busybox \
&& tar xf busybox.tar.bz2 --strip-components=1 -C /root/busybox
&& tar xf busybox.tar.bz2 --strip-components=1 -C /root/busybox \
&& rm busybox.tar.bz2
WORKDIR /root/busybox
RUN make defconfig \
&& sed -i "s/# CONFIG_STATIC is not set/CONFIG_STATIC=y/g" .config \

View File

@ -8,7 +8,12 @@ VERSION=$( grep -m1 -o '[0-9]\+\.[0-9]\+\.[0-9]\+' ${CARGO_TOML_PATH} | sed 's/[
IMAGE_NAME=jinuxdev/jinux:${VERSION}
DOCKER_FILE=${SCRIPT_DIR}/Dockerfile.ubuntu22.04
ARCH=linux/amd64
RUST_TOOLCHAIN_PATH=${SCRIPT_DIR}/../../rust-toolchain.toml
JINUX_RUST_VERSION=$( grep -m1 -o 'nightly-[0-9]\+-[0-9]\+-[0-9]\+' ${RUST_TOOLCHAIN_PATH} )
# Build docker
cd ${SCRIPT_DIR}
docker buildx build -f ${DOCKER_FILE} --platform ${ARCH} -t ${IMAGE_NAME} .
docker buildx build -f ${DOCKER_FILE} \
--build-arg JINUX_RUST_VERSION=${JINUX_RUST_VERSION} \
--platform ${ARCH} \
-t ${IMAGE_NAME} .