mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2024-11-24 08:32:50 +02:00
28 lines
648 B
Bash
Executable File
28 lines
648 B
Bash
Executable File
#!/bin/bash
|
|
|
|
. mailcow.conf
|
|
./build-network.sh
|
|
|
|
NAME="memcached-mailcow"
|
|
|
|
echo "Stopping and removing containers with name tag ${NAME}..."
|
|
if [[ ! -z $(docker ps -af "name=${NAME}" -q) ]]; then
|
|
docker stop $(docker ps -af "name=${NAME}" -q)
|
|
docker rm $(docker ps -af "name=${NAME}" -q)
|
|
fi
|
|
|
|
if [[ ! -z "$(docker images -q rmilter)" ]]; then
|
|
read -r -p "Found image locally. Rebuild anyway? [y/N] " response
|
|
response=${response,,}
|
|
if [[ $response =~ ^(yes|y)$ ]]; then
|
|
docker rmi memcached
|
|
fi
|
|
fi
|
|
|
|
docker run \
|
|
--network=${DOCKER_NETWORK} \
|
|
-h memcached \
|
|
--network-alias memcached \
|
|
--name=${NAME} \
|
|
-d memcached
|