mirror of
https://github.com/dokku/dokku.git
synced 2025-12-15 19:47:42 +01:00
feat: enable live-restore by default when installing Dokku
This will help users have more seamless upgrades in the future in cases where docker is restarted.
This commit is contained in:
4
debian/control
vendored
4
debian/control
vendored
@@ -3,9 +3,9 @@ Version: 0.37.0
|
||||
Section: web
|
||||
Priority: optional
|
||||
Architecture: amd64
|
||||
Depends: apache2-utils, locales, git, cpio, cron, curl, man-db, netcat, sshcommand, docker-engine-cs (>= 19.03.0) | docker-engine (>= 19.03.0) | docker-io (>= 19.03.0) | docker.io (>= 19.03.0) | docker-ce (>= 19.03.0) | docker-ee (>= 19.03.0) | moby-engine, docker-compose-plugin | moby-compose, docker-buildx-plugin | moby-buildx, docker-container-healthchecker, docker-image-labeler, lambda-builder, net-tools, netrc, parallel, procfile-util, rsync, dos2unix, jq, unzip, util-linux
|
||||
Depends: apache2-utils, locales, git, cpio, cron, curl, man-db, netcat, sshcommand, docker-engine-cs (>= 19.03.0) | docker-engine (>= 19.03.0) | docker-io (>= 19.03.0) | docker.io (>= 19.03.0) | docker-ce (>= 19.03.0) | docker-ee (>= 19.03.0) | moby-engine, docker-compose-plugin | moby-compose, docker-buildx-plugin | moby-buildx, docker-container-healthchecker, docker-image-labeler, lambda-builder, net-tools, netrc, parallel, procfile-util, rsync, dos2unix, unzip, util-linux
|
||||
Recommends: herokuish, bash-completion, dokku-update, dokku-event-listener
|
||||
Pre-Depends: gliderlabs-sigil, nginx (>= 1.8.0) | openresty, bind9-dnsutils, debconf, plugn, sudo, python3, rsyslog
|
||||
Pre-Depends: gliderlabs-sigil, jq, nginx (>= 1.8.0) | openresty, bind9-dnsutils, debconf, plugn, sudo, python3, rsyslog
|
||||
Maintainer: Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>
|
||||
Description: Docker-powered PaaS that helps build and manage the lifecycle of applications
|
||||
Dokku is an extensible, open source Platform as a Service
|
||||
|
||||
34
debian/postinst
vendored
34
debian/postinst
vendored
@@ -24,6 +24,39 @@ call-sshcommand() {
|
||||
fi
|
||||
}
|
||||
|
||||
setup-docker-live-restore() {
|
||||
# skip if running in docker-based installation
|
||||
if [[ "$DOKKU_INIT_SYSTEM" == "sv" ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
# allow disabling via /etc/default/dokku
|
||||
if [[ "$DOKKU_LIVE_RESTORE" == "false" ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
live_restore="$(docker info --format '{{ .LiveRestoreEnabled }}' || true)"
|
||||
if [ "$live_restore" = "true" ]; then
|
||||
echo "Docker live-restore is already enabled"
|
||||
return
|
||||
fi
|
||||
|
||||
echo "Enabling docker live-restore"
|
||||
if [[ ! -f /etc/docker/daemon.json ]]; then
|
||||
echo "{}" >/etc/docker/daemon.json
|
||||
fi
|
||||
|
||||
config="$(jq '. + {"live-restore": true}' /etc/docker/daemon.json)"
|
||||
echo "$config" >/etc/docker/daemon.json
|
||||
if command -v systemctl &>/dev/null; then
|
||||
if ! systemctl reload docker; then
|
||||
echo "Unable to reload docker, please reload manually" 1>&2
|
||||
fi
|
||||
else
|
||||
echo "Unable to reload docker, please reload manually" 1>&2
|
||||
fi
|
||||
}
|
||||
|
||||
setup-user() {
|
||||
echo "Setting up dokku user"
|
||||
call-sshcommand create dokku /usr/bin/dokku
|
||||
@@ -135,6 +168,7 @@ case "$1" in
|
||||
dpkg-handling
|
||||
setup-plugins
|
||||
setup-sshcommand
|
||||
setup-docker-live-restore
|
||||
;;
|
||||
|
||||
*)
|
||||
|
||||
Reference in New Issue
Block a user