mirror of
https://github.com/stucki/docker-lineageos
synced 2025-01-09 17:39:47 -05:00
After successful build, delete existing containers
This commit is contained in:
parent
a352f54870
commit
000fe51fef
@ -5,6 +5,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
## [Unreleased][unreleased]
|
||||
### Fixed
|
||||
- Fix check if build is needed
|
||||
- After successful build, delete existing containers
|
||||
|
||||
## [0.3.0] - 2015-03-31
|
||||
### Added
|
||||
|
6
run.sh
6
run.sh
@ -22,6 +22,12 @@ if [ $? -ne 0 ]; then
|
||||
elif [[ $FORCE_BUILD = 1 ]] || ! echo "$IMAGE_EXISTS" | grep -q "$TAG"; then
|
||||
echo "Building Docker image $REPOSITORY:$TAG..."
|
||||
docker build -t $REPOSITORY:$TAG .
|
||||
|
||||
# After successful build, delete existing containers
|
||||
IS_EXISTING=$(docker inspect -f '{{.Id}}' $CONTAINER 2>/dev/null)
|
||||
if [[ -n "$IS_EXISTING" ]]; then
|
||||
docker rm $CONTAINER
|
||||
fi
|
||||
fi
|
||||
|
||||
# With the given name $CONTAINER, reconnect to running container, start
|
||||
|
Loading…
x
Reference in New Issue
Block a user