From 557ee64cf320282c8b9490ce612bff3cfbd62e8d Mon Sep 17 00:00:00 2001 From: asonix Date: Mon, 8 Jun 2020 12:43:28 -0500 Subject: [PATCH] Do better about caching --- docker/dev/Dockerfile.amd64 | 18 ++++++++++-------- docker/dev/Dockerfile.arm32v7 | 18 ++++++++++-------- docker/dev/Dockerfile.arm64v8 | 18 ++++++++++-------- 3 files changed, 30 insertions(+), 24 deletions(-) diff --git a/docker/dev/Dockerfile.amd64 b/docker/dev/Dockerfile.amd64 index 0ae378e..5f9cc44 100644 --- a/docker/dev/Dockerfile.amd64 +++ b/docker/dev/Dockerfile.amd64 @@ -1,15 +1,11 @@ -FROM rustembedded/cross:x86_64-unknown-linux-musl AS builder +FROM rustembedded/cross:x86_64-unknown-linux-musl AS x86_64-builder ARG UID=991 ARG GID=991 -ARG TOOLCHAIN=stable -ARG TARGET=x86_64-unknown-linux-musl -ARG TOOL=x86_64-linux-musl - -ARG REPOSITORY=https://git.asonix.dog/asonix/pict-rs -ARG TAG=master -ARG BINARY=pict-rs +ENV TOOLCHAIN=stable +ENV TARGET=x86_64-unknown-linux-musl +ENV TOOL=x86_64-linux-musl RUN \ apt-get update && \ @@ -40,6 +36,12 @@ RUN \ ./rustup.sh --default-toolchain $TOOLCHAIN --profile minimal -y && \ rustup target add $TARGET +FROM x86_64-builder as builder + +ARG TAG=master +ARG REPOSITORY=https://git.asonix.dog/asonix/pict-rs +ARG BINARY=pict-rs + RUN \ git clone -b $TAG $REPOSITORY repo diff --git a/docker/dev/Dockerfile.arm32v7 b/docker/dev/Dockerfile.arm32v7 index faabe9e..1c253dc 100644 --- a/docker/dev/Dockerfile.arm32v7 +++ b/docker/dev/Dockerfile.arm32v7 @@ -1,15 +1,11 @@ -FROM rustembedded/cross:arm-unknown-linux-musleabihf AS builder +FROM rustembedded/cross:arm-unknown-linux-musleabihf AS arm32v7-builder ARG UID=991 ARG GID=991 -ARG TOOLCHAIN=stable -ARG TARGET=arm-unknown-linux-musleabihf -ARG TOOL=arm-linux-musleabihf - -ARG REPOSITORY=https://git.asonix.dog/asonix/pict-rs -ARG TAG=master -ARG BINARY=pict-rs +ENV TOOLCHAIN=stable +ENV TARGET=arm-unknown-linux-musleabihf +ENV TOOL=arm-linux-musleabihf RUN \ apt-get update && \ @@ -40,6 +36,12 @@ RUN \ ./rustup.sh --default-toolchain $TOOLCHAIN --profile minimal -y && \ rustup target add $TARGET +FROM arm32v7-builder as builder + +ARG TAG=master +ARG REPOSITORY=https://git.asonix.dog/asonix/pict-rs +ARG BINARY=pict-rs + RUN \ git clone -b $TAG $REPOSITORY repo diff --git a/docker/dev/Dockerfile.arm64v8 b/docker/dev/Dockerfile.arm64v8 index 3d1daaa..011e665 100644 --- a/docker/dev/Dockerfile.arm64v8 +++ b/docker/dev/Dockerfile.arm64v8 @@ -1,15 +1,11 @@ -FROM rustembedded/cross:aarch64-unknown-linux-musl AS builder +FROM rustembedded/cross:aarch64-unknown-linux-musl AS aarch64-builder ARG UID=991 ARG GID=991 -ARG TOOLCHAIN=stable -ARG TARGET=aarch64-unknown-linux-musl -ARG TOOL=aarch64-linux-musl - -ARG REPOSITORY=https://git.asonix.dog/asonix/pict-rs -ARG TAG=master -ARG BINARY=pict-rs +ENV TOOLCHAIN=stable +ENV TARGET=aarch64-unknown-linux-musl +ENV TOOL=aarch64-linux-musl RUN \ apt-get update && \ @@ -40,6 +36,12 @@ RUN \ ./rustup.sh --default-toolchain $TOOLCHAIN --profile minimal -y && \ rustup target add $TARGET +FROM aarch64-builder as builder + +ARG TAG=master +ARG REPOSITORY=https://git.asonix.dog/asonix/pict-rs +ARG BINARY=pict-rs + RUN \ git clone -b $TAG $REPOSITORY repo