From fff050c71d23a4a076c5f65a567249ea64ace72d Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 16 Apr 2016 17:46:07 -0400 Subject: [PATCH] Warn users when there is a low memory condition on installation Closes #1971 [ci skip] --- bootstrap.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bootstrap.sh b/bootstrap.sh index 3a7fb2c93..2adc0d85f 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -12,6 +12,7 @@ set -eo pipefail; [[ $TRACE ]] && set -x # It also means that we can't run a partially downloaded script. ensure-environment() { + local FREE_MEMORY echo "Preparing to install $DOKKU_TAG from $DOKKU_REPO..." if ! command -v apt-get &>/dev/null; then echo "This installation script requires apt-get. For manual installation instructions, consult http://dokku.viewdocs.io/dokku/advanced-installation/" @@ -22,6 +23,12 @@ ensure-environment() { echo "This installation script requires that you have a hostname set for the instance. Please set a hostname for 127.0.0.1 in your /etc/hosts" exit 1 } + + FREE_MEMORY=$(grep MemTotal /proc/meminfo | awk '{print $2}') + if [[ "$FREE_MEMORY" -lt 1003600 ]]; then + echo "For dokku to build containers, it is strongly suggested that you have 1024 megabytes or more of free memory" + echo "If necessary, please consult this document to setup swap: http://dokku.viewdocs.io/dokku/advanced-installation/#vms-with-less-than-1gb-of-memory" + fi } install-requirements() {