diff --git a/scripts/install_client.sh b/scripts/install_client.sh index d5567bf8a..1b6fd4572 100755 --- a/scripts/install_client.sh +++ b/scripts/install_client.sh @@ -116,6 +116,9 @@ if ! test -v PERSISTENT; then # Disable user password passwd -d student + # Enable docker relocation + systemctl enable mount-docker + # Remove tty cat <<-EOF>> /etc/systemd/logind.conf NAutoVTs=0 diff --git a/scripts/system/etc/systemd/system/mount-docker.service b/scripts/system/etc/systemd/system/mount-docker.service new file mode 100644 index 000000000..0ad039aff --- /dev/null +++ b/scripts/system/etc/systemd/system/mount-docker.service @@ -0,0 +1,10 @@ +[Unit] +Description=Docker relocation +Before=docker.service + +[Service] +ExecStart=/usr/local/bin/mount-docker.sh +Type=oneshot + +[Install] +RequiredBy=docker.service diff --git a/scripts/system/usr/local/bin/mount-docker.sh b/scripts/system/usr/local/bin/mount-docker.sh new file mode 100755 index 000000000..52fdeea78 --- /dev/null +++ b/scripts/system/usr/local/bin/mount-docker.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Unofficial Bash Strict Mode +set -euo pipefail +IFS=' +' + +cp -a /var/lib/docker /tmp +mount -t tmpfs -osize=2G tmpfs /var/lib/docker +mv /tmp/docker/* /var/lib/docker