diff --git a/002-build-pdns.sh b/002-build-pdns.sh index 75d1aa3f..b0a18535 100755 --- a/002-build-pdns.sh +++ b/002-build-pdns.sh @@ -10,24 +10,9 @@ if [[ ! -z $(docker ps -af "name=${NAME}" -q) ]]; then docker rm $(docker ps -af "name=${NAME}" -q) fi -build() { - docker build --no-cache -t pdns data/Dockerfiles/pdns/. -} - -if [[ ! -z "$(docker images -q pdns)" ]]; then - read -r -p "Found image locally. Delete local and rebuild without cache anyway? [y/N] " response - response=${response,,} - if [[ $response =~ ^(yes|y)$ ]]; then - docker rmi pdns - build - fi -else - build -fi - docker run \ -v ${PWD}/data/conf/pdns/:/etc/powerdns/ \ --network=${DOCKER_NETWORK} \ -h pdns \ --name ${NAME} \ - -d pdns + -d andryyy/mailcow-dockerized:pdns diff --git a/005-build-rspamd.sh b/005-build-rspamd.sh index 1ace7644..f1f3fa1d 100755 --- a/005-build-rspamd.sh +++ b/005-build-rspamd.sh @@ -4,10 +4,6 @@ NAME="rspamd-mailcow" -build() { - docker build --no-cache -t rspamd data/Dockerfiles/rspamd/. -} - PDNS_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' pdns-mailcow 2> /dev/null) if [[ ! ${PDNS_IP} =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "Cannot determine Powerdns Recursor ip address. Is the container running?" @@ -20,17 +16,6 @@ if [[ ! -z $(docker ps -af "name=${NAME}" -q) ]]; then docker rm $(docker ps -af "name=${NAME}" -q) fi -if [[ ! -z "$(docker images -q rspamd)" ]]; then - read -r -p "Found image locally. Delete local and rebuild without cache anyway? [y/N] " response - response=${response,,} - if [[ $response =~ ^(yes|y)$ ]]; then - docker rmi rspamd - build - fi -else - build -fi - # Needs network-alias because of different dns docker run \ @@ -45,7 +30,7 @@ docker run \ --network-alias=rspamd \ -h rspamd \ --name ${NAME} \ - -d rspamd + -d andryyy/mailcow-dockerized:rspamd /bin/bash ./fix-permissions.sh diff --git a/008-build-rmilter.sh b/008-build-rmilter.sh index 09766758..0bec168f 100755 --- a/008-build-rmilter.sh +++ b/008-build-rmilter.sh @@ -10,24 +10,9 @@ if [[ ! -z $(docker ps -af "name=${NAME}" -q) ]]; then docker rm $(docker ps -af "name=${NAME}" -q) fi -build() { - docker build --no-cache -t rmilter data/Dockerfiles/rmilter/. -} - -if [[ ! -z "$(docker images -q rmilter)" ]]; then - read -r -p "Found image locally. Delete local and rebuild without cache anyway? [y/N] " response - response=${response,,} - if [[ $response =~ ^(yes|y)$ ]]; then - docker rmi rmilter - build - fi -else - build -fi - docker run \ -v ${PWD}/data/conf/rmilter/:/etc/rmilter.conf.d/:ro \ --network=${DOCKER_NETWORK} \ -h rmilter \ --name ${NAME} \ - -d rmilter + -d andryyy/mailcow-dockerized:rmilter diff --git a/009-build-dovecot.sh b/009-build-dovecot.sh index 4d58c8ca..26f79df0 100755 --- a/009-build-dovecot.sh +++ b/009-build-dovecot.sh @@ -4,32 +4,12 @@ source mailcow.conf NAME="dovecot-mailcow" -build() { - docker build --no-cache -t dovecot:local data/Dockerfiles/dovecot/. -} - -if [[ ${1} == "--reconf" ]]; then - reconf - exit 0 -fi - 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 dovecot)" ]]; then - read -r -p "Found image locally. Delete local and rebuild without cache anyway? [y/N] " response - response=${response,,} - if [[ $response =~ ^(yes|y)$ ]]; then - docker rmi dovecot:local - build - fi -else - build -fi - sed -i "/^connect/c\connect = \"host=mysql dbname=${DBNAME} user=${DBUSER} password=${DBPASS}\"" data/conf/dovecot/sql/* docker run \ diff --git a/010-build-postfix.sh b/010-build-postfix.sh index 4531848b..34dbdac0 100755 --- a/010-build-postfix.sh +++ b/010-build-postfix.sh @@ -10,32 +10,12 @@ if [[ ! ${PDNS_IP} =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then exit 1 fi -build() { - docker build --no-cache -t postfix data/Dockerfiles/postfix/. -} - -if [[ ${1} == "--reconf" ]]; then - reconf - exit 0 -fi - 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 postfix)" ]]; then - read -r -p "Found image locally. Delete local and rebuild without cache anyway? [y/N] " response - response=${response,,} - if [[ $response =~ ^(yes|y)$ ]]; then - docker rmi postfix - build - fi -else - build -fi - sed -i "/^user/c\user = ${DBUSER}" data/conf/postfix/sql/* sed -i "/^password/c\password = ${DBPASS}" data/conf/postfix/sql/* sed -i "/^dbname/c\dbname = ${DBNAME}" data/conf/postfix/sql/* @@ -52,4 +32,4 @@ docker run \ --network=${DOCKER_NETWORK} \ --network-alias postfix \ -h ${MAILCOW_HOSTNAME} \ - -d postfix + -d andryyy/mailcow-dockerized:postfix diff --git a/012-build-sogo.sh b/012-build-sogo.sh index 9c932468..c24cd965 100755 --- a/012-build-sogo.sh +++ b/012-build-sogo.sh @@ -10,21 +10,6 @@ if [[ ! -z $(docker ps -af "name=${NAME}" -q) ]]; then docker rm $(docker ps -af "name=${NAME}" -q) fi -build() { - docker build --no-cache -t sogo data/Dockerfiles/sogo/. -} - -if [[ ! -z "$(docker images -q sogo)" ]]; then - read -r -p "Found image locally. Delete local and rebuild without cache anyway? [y/N] " response - response=${response,,} # tolower - if [[ $response =~ ^(yes|y)$ ]]; then - docker rmi sogo - build - fi -else - build -fi - sed -i "s#OCSEMailAlarmsFolderURL.*#OCSEMailAlarmsFolderURL = \"mysql://${DBUSER}:${DBPASS}@mysql:3306/${DBNAME}/sogo_alarms_folder\";#" data/conf/sogo/sogo.conf sed -i "s#OCSFolderInfoURL.*#OCSFolderInfoURL = \"mysql://${DBUSER}:${DBPASS}@mysql:3306/${DBNAME}/sogo_folder_info\";#" data/conf/sogo/sogo.conf sed -i "s#OCSSessionsFolderURL.*#OCSSessionsFolderURL = \"mysql://${DBUSER}:${DBPASS}@mysql:3306/${DBNAME}/sogo_sessions_folder\";#" data/conf/sogo/sogo.conf @@ -38,4 +23,4 @@ docker run \ --network=${DOCKER_NETWORK} \ --network-alias sogo \ -h sogo \ - -d -t sogo + -d -t andryyy/mailcow-dockerized:sogo