mirror of
https://github.com/Fishwaldo/build.git
synced 2025-07-12 07:58:47 +00:00
Docker: add command dockerpurge to recreate armbian containters
This commit is contained in:
parent
a58c8d1133
commit
3a143a8dfa
1 changed files with 11 additions and 1 deletions
12
compile.sh
12
compile.sh
|
@ -31,7 +31,7 @@ fi
|
||||||
|
|
||||||
if [[ $EUID == 0 ]] || [[ "$1" == vagrant ]]; then
|
if [[ $EUID == 0 ]] || [[ "$1" == vagrant ]]; then
|
||||||
:
|
:
|
||||||
elif [[ "$1" == docker ]] && grep -q `whoami` <(getent group docker); then
|
elif [[ "$1" == docker || "$1" == dockerpurge ]] && grep -q `whoami` <(getent group docker); then
|
||||||
:
|
:
|
||||||
else
|
else
|
||||||
display_alert "This script requires root privileges, trying to use sudo" "" "wrn"
|
display_alert "This script requires root privileges, trying to use sudo" "" "wrn"
|
||||||
|
@ -113,6 +113,16 @@ if [[ "$1" == docker && -f /etc/debian_version && -z "$(which docker)" ]]; then
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "$1" == dockerpurge && -f /etc/debian_version ]]; then
|
||||||
|
display_alert "Purging Armbian Docker containers" "" "wrn"
|
||||||
|
docker container ls -a | grep armbian | awk '{print $1}' | xargs docker container rm &> /dev/null
|
||||||
|
docker image ls | grep armbian | awk '{print $3}' | xargs docker image rm &> /dev/null
|
||||||
|
shift
|
||||||
|
arr=("docker" "$@")
|
||||||
|
"$SRC/compile.sh" ${arr[@]}
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
|
|
||||||
# Create userpatches directory if not exists
|
# Create userpatches directory if not exists
|
||||||
mkdir -p $SRC/userpatches
|
mkdir -p $SRC/userpatches
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue