Merge pull request #1340 from zhangn1985/master

Docker: do not rebuild docker image everytime.
This commit is contained in:
Igor Pečovnik 2019-04-11 08:08:28 +02:00 committed by GitHub
commit cf38a8cbc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,14 +14,18 @@ mkdir -p $SRC/{output,userpatches}
grep -q '^docker:' /etc/group && chgrp --quiet docker $SRC/{output,userpatches}
chmod --quiet g+w,g+s $SRC/{output,userpatches}
# build a new container based on provided Dockerfile
display_alert "Building a Docker container"
if ! docker build -t armbian . ; then
STATUS=$?
# Adding a newline, so the alert won't be shown in the same line as the error
echo
display_alert "Docker container build exited with code: " "$STATUS" "err"
exit 1
if grep -q armbian <(docker images); then
display_alert "Using existed a armbian Docker container"
else
# build a new container based on provided Dockerfile
display_alert "Building a Docker container"
if ! docker build -t armbian . ; then
STATUS=$?
# Adding a newline, so the alert won't be shown in the same line as the error
echo
display_alert "Docker container build exited with code: " "$STATUS" "err"
exit 1
fi
fi
DOCKER_FLAGS=()