From 35d0aef0d478e672f735c9de016e4ac37cda9fc6 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Mon, 7 Jul 2014 16:59:37 +0200 Subject: [PATCH] simplify firmware-docker-build.sh --- firmware-docker-build.sh | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/firmware-docker-build.sh b/firmware-docker-build.sh index ab44c9c524..3df89a88b3 100755 --- a/firmware-docker-build.sh +++ b/firmware-docker-build.sh @@ -2,20 +2,15 @@ dirname $0 -# Build trezor firmware -docker build . | tee firmware-docker-build.log +IMAGETAG=trezor-mcu-build +docker rmi $IMAGETAG || : +docker build -t $IMAGETAG . -# Parse image name -IMAGE=`grep "Successfully built" firmware-docker-build.log | tail -n1 | cut -d' ' -f3` -echo "IMAGE NAME: $IMAGE" +CONTAINERTAG=trezor-mcu-build +docker rm $CONTAINERTAG || : +docker run --name $CONTAINERTAG $IMAGETAG true -docker run -t $IMAGE true - -# Parse container name -CONTAINER=`docker ps -a | grep true | head -n1 | cut -d' ' -f1` -echo "CONTAINER NAME: $CONTAINER" - -docker cp $CONTAINER:/trezor-mcu/firmware/trezor.bin . +docker cp $CONTAINERTAG:/trezor-mcu/firmware/trezor.bin . echo "---------------------" echo "Firmware fingerprint:"