mirror of
https://github.com/Fishwaldo/build.git
synced 2025-06-15 10:41:31 +00:00
Merge pull request #1340 from zhangn1985/master
Docker: do not rebuild docker image everytime.
This commit is contained in:
commit
cf38a8cbc1
1 changed files with 12 additions and 8 deletions
|
@ -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=()
|
||||
|
|
Loading…
Add table
Reference in a new issue