1
0
mirror of https://github.com/stucki/docker-lineageos synced 2024-12-19 17:12:29 -05:00

run.sh: Add tag to repository name

This commit is contained in:
Michael Stucki 2015-03-15 17:38:12 +01:00
parent 8a4556437a
commit ba5afade76

9
run.sh
View File

@ -7,6 +7,7 @@ CCACHE=$(pwd)/ccache
CONTAINER_HOME=/home/cmbuild CONTAINER_HOME=/home/cmbuild
CONTAINER=cyanogenmod CONTAINER=cyanogenmod
REPOSITORY=stucki/cyanogenmod REPOSITORY=stucki/cyanogenmod
TAG=cm-12.1
FORCE_BUILD=0 FORCE_BUILD=0
# Create shared folders # Create shared folders
@ -14,13 +15,13 @@ mkdir -p $SOURCE
mkdir -p $CCACHE mkdir -p $CCACHE
# Build image if needed # Build image if needed
IMAGE_EXISTS=$(docker images -q $REPOSITORY) IMAGE_EXISTS=$(docker images $REPOSITORY | grep "$TAG")
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "docker command not found" echo "docker command not found"
exit $? exit $?
elif [[ -z $IMAGE_EXISTS ]] || [[ $FORCE_BUILD = 1 ]]; then elif [[ -z $IMAGE_EXISTS ]] || [[ $FORCE_BUILD = 1 ]]; then
echo "Building Docker image $REPOSITORY..." echo "Building Docker image $REPOSITORY:$TAG..."
docker build -t $REPOSITORY . docker build -t $REPOSITORY:$TAG .
fi fi
# With the given name $CONTAINER, reconnect to running container, start # With the given name $CONTAINER, reconnect to running container, start
@ -31,7 +32,7 @@ if [[ $IS_RUNNING == "true" ]]; then
elif [[ $IS_RUNNING == "false" ]]; then elif [[ $IS_RUNNING == "false" ]]; then
docker start -i $CONTAINER docker start -i $CONTAINER
else else
docker run -v $SOURCE:$CONTAINER_HOME/android -v $CCACHE:/srv/ccache -i -t --name $CONTAINER $REPOSITORY docker run -v $SOURCE:$CONTAINER_HOME/android -v $CCACHE:/srv/ccache -i -t --name $CONTAINER $REPOSITORY:$TAG
fi fi
exit $? exit $?