Allow pre-built images to be used to speed up building
This commit is contained in:
@@ -1,11 +1,24 @@
|
|||||||
TAG_NAME="amd64-buster"
|
TARGET_NAME="amd64-buster"
|
||||||
OUT_DIR="out_$TAG_NAME"
|
|
||||||
DOCKERFILE="Dockerfile.amd64.buster"
|
DOCKERFILE="Dockerfile.amd64.buster"
|
||||||
|
|
||||||
|
TAG_UNIQUE_ID=`git ls-tree HEAD | sha256sum | cut -c-16`
|
||||||
|
TAG_NAME="${TARGET_NAME}_${TAG_UNIQUE_ID}"
|
||||||
|
OUT_DIR="out_$TARGET_NAME"
|
||||||
|
|
||||||
|
docker pull cgutman/moonlight-packaging:$TAG_NAME
|
||||||
|
PULL_EXIT_CODE=$?
|
||||||
|
|
||||||
rm -rf $OUT_DIR
|
rm -rf $OUT_DIR
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
mkdir $OUT_DIR
|
mkdir $OUT_DIR
|
||||||
|
|
||||||
docker build -f $DOCKERFILE -t cgutman/moonlight-packaging:$TAG_NAME .
|
if [ $PULL_EXIT_CODE -eq 0 ]; then
|
||||||
|
echo Using pre-built Docker image - cgutman/moonlight-packaging:$TAG_NAME
|
||||||
|
else
|
||||||
|
echo Pre-built image not available - building cgutman/moonlight-packaging:$TAG_NAME
|
||||||
|
docker build -f $DOCKERFILE -t cgutman/moonlight-packaging:$TAG_NAME .
|
||||||
|
echo Built Docker image - cgutman/moonlight-packaging:$TAG_NAME
|
||||||
|
fi
|
||||||
|
|
||||||
docker run --rm --mount type=bind,source="$(pwd)"/$OUT_DIR,target=/out --mount type=bind,source="$(pwd)"/debian,target=/opt/debian -e COMMIT="$1" cgutman/moonlight-packaging:$TAG_NAME
|
docker run --rm --mount type=bind,source="$(pwd)"/$OUT_DIR,target=/out --mount type=bind,source="$(pwd)"/debian,target=/opt/debian -e COMMIT="$1" cgutman/moonlight-packaging:$TAG_NAME
|
||||||
19
build-l4t.sh
19
build-l4t.sh
@@ -1,11 +1,24 @@
|
|||||||
TAG_NAME="l4t-bionic"
|
TARGET_NAME="l4t-bionic"
|
||||||
OUT_DIR="out_$TAG_NAME"
|
|
||||||
DOCKERFILE="Dockerfile.l4t.bionic"
|
DOCKERFILE="Dockerfile.l4t.bionic"
|
||||||
|
|
||||||
|
TAG_UNIQUE_ID=`git ls-tree HEAD | sha256sum | cut -c-16`
|
||||||
|
TAG_NAME="${TARGET_NAME}_${TAG_UNIQUE_ID}"
|
||||||
|
OUT_DIR="out_$TARGET_NAME"
|
||||||
|
|
||||||
|
docker pull cgutman/moonlight-packaging:$TAG_NAME
|
||||||
|
PULL_EXIT_CODE=$?
|
||||||
|
|
||||||
rm -rf $OUT_DIR
|
rm -rf $OUT_DIR
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
mkdir $OUT_DIR
|
mkdir $OUT_DIR
|
||||||
|
|
||||||
docker build -f $DOCKERFILE -t cgutman/moonlight-packaging:$TAG_NAME .
|
if [ $PULL_EXIT_CODE -eq 0 ]; then
|
||||||
|
echo Using pre-built Docker image - cgutman/moonlight-packaging:$TAG_NAME
|
||||||
|
else
|
||||||
|
echo Pre-built image not available - building cgutman/moonlight-packaging:$TAG_NAME
|
||||||
|
docker build -f $DOCKERFILE -t cgutman/moonlight-packaging:$TAG_NAME .
|
||||||
|
echo Built Docker image - cgutman/moonlight-packaging:$TAG_NAME
|
||||||
|
fi
|
||||||
|
|
||||||
docker run --rm --runtime nvidia --mount type=bind,source="$(pwd)"/$OUT_DIR,target=/out --mount type=bind,source="$(pwd)"/debian,target=/opt/debian -e COMMIT="$1" cgutman/moonlight-packaging:$TAG_NAME
|
docker run --rm --runtime nvidia --mount type=bind,source="$(pwd)"/$OUT_DIR,target=/out --mount type=bind,source="$(pwd)"/debian,target=/opt/debian -e COMMIT="$1" cgutman/moonlight-packaging:$TAG_NAME
|
||||||
19
build-rpi.sh
19
build-rpi.sh
@@ -1,11 +1,24 @@
|
|||||||
TAG_NAME="rpi-buster"
|
TARGET_NAME="rpi-buster"
|
||||||
OUT_DIR="out_$TAG_NAME"
|
|
||||||
DOCKERFILE="Dockerfile.rpi.buster"
|
DOCKERFILE="Dockerfile.rpi.buster"
|
||||||
|
|
||||||
|
TAG_UNIQUE_ID=`git ls-tree HEAD | sha256sum | cut -c-16`
|
||||||
|
TAG_NAME="${TARGET_NAME}_${TAG_UNIQUE_ID}"
|
||||||
|
OUT_DIR="out_$TARGET_NAME"
|
||||||
|
|
||||||
|
docker pull cgutman/moonlight-packaging:$TAG_NAME
|
||||||
|
PULL_EXIT_CODE=$?
|
||||||
|
|
||||||
rm -rf $OUT_DIR
|
rm -rf $OUT_DIR
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
mkdir $OUT_DIR
|
mkdir $OUT_DIR
|
||||||
|
|
||||||
docker build -f $DOCKERFILE -t cgutman/moonlight-packaging:$TAG_NAME .
|
if [ $PULL_EXIT_CODE -eq 0 ]; then
|
||||||
|
echo Using pre-built Docker image - cgutman/moonlight-packaging:$TAG_NAME
|
||||||
|
else
|
||||||
|
echo Pre-built image not available - building cgutman/moonlight-packaging:$TAG_NAME
|
||||||
|
docker build -f $DOCKERFILE -t cgutman/moonlight-packaging:$TAG_NAME .
|
||||||
|
echo Built Docker image - cgutman/moonlight-packaging:$TAG_NAME
|
||||||
|
fi
|
||||||
|
|
||||||
docker run --rm --mount type=bind,source="$(pwd)"/$OUT_DIR,target=/out --mount type=bind,source="$(pwd)"/debian,target=/opt/debian -e COMMIT="$1" cgutman/moonlight-packaging:$TAG_NAME
|
docker run --rm --mount type=bind,source="$(pwd)"/$OUT_DIR,target=/out --mount type=bind,source="$(pwd)"/debian,target=/opt/debian -e COMMIT="$1" cgutman/moonlight-packaging:$TAG_NAME
|
||||||
11
push-images.sh
Executable file
11
push-images.sh
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
set -e
|
||||||
|
|
||||||
|
TAG_UNIQUE_ID=`git ls-tree HEAD | sha256sum | cut -c-16`
|
||||||
|
|
||||||
|
docker build -f Dockerfile.rpi.buster -t cgutman/moonlight-packaging:rpi-buster_$TAG_UNIQUE_ID .
|
||||||
|
docker build -f Dockerfile.amd64.buster -t cgutman/moonlight-packaging:amd64-buster_$TAG_UNIQUE_ID .
|
||||||
|
docker build -f Dockerfile.l4t.bionic -t cgutman/moonlight-packaging:l4t-bionic_$TAG_UNIQUE_ID .
|
||||||
|
|
||||||
|
docker push cgutman/moonlight-packaging:rpi-buster_$TAG_UNIQUE_ID
|
||||||
|
docker push cgutman/moonlight-packaging:amd64-buster_$TAG_UNIQUE_ID
|
||||||
|
docker push cgutman/moonlight-packaging:l4t-bionic_$TAG_UNIQUE_ID
|
||||||
Reference in New Issue
Block a user