mirror of
https://github.com/sstent/unifi.git
synced 2025-12-06 06:01:37 +00:00
17 lines
468 B
Bash
17 lines
468 B
Bash
#!/bin/bash
|
|
VERSION=5.2.9
|
|
VMNAME=${1:-unifi5}
|
|
if [ -r Dockerfile.$VMNAME ]; then
|
|
DOCKER_USER=${DOCKER_USER:-tommi2day}
|
|
#build the container
|
|
docker stop $VMNAME
|
|
docker rm $VMNAME
|
|
docker build -t $DOCKER_USER/$VMNAME:$VERSION -f Dockerfile.$VMNAME . |tee build.log
|
|
IMAGE=$(awk '/^Successfully/ {print $3}' build.log)
|
|
if [ -n "$IMAGE" ]; then
|
|
docker tag $IMAGE $DOCKER_USER/$VMNAME:latest
|
|
fi
|
|
else
|
|
echo "Usage: $0 VMNAME #Dockerfile.VMNAME must exists"
|
|
fi
|