Last active
August 11, 2017 20:50
-
-
Save Rillke/fce689ec63c3611cea815d1d92dcc5f1 to your computer and use it in GitHub Desktop.
Switch Docker to use Overlay2 FS instead of the default (used on Ubuntu Trusty and Xenial [systemd])
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First, make sure you're using systemd and | |
# the prerequisites are fulfilled: | |
# https://docs.docker.com/engine/userguide/storagedriver/overlayfs-driver/#prerequisites | |
if [ "$EUID" -ne 0 ] | |
then echo "Please run as root" | |
exit | |
fi | |
mkdir -p /etc/systemd/system/docker.service.d | |
export DOCKER_START_COMMAND=$(awk -F "=" '/ExecStart/ {print $2}' /lib/systemd/system/docker.service) | |
export DOCKER_STORAGE_CONFIG_FILE=/etc/systemd/system/docker.service.d/storage.conf | |
cat > $DOCKER_STORAGE_CONFIG_FILE <<- EOM | |
[Service] | |
ExecStart= | |
EOM | |
echo "ExecStart=${DOCKER_START_COMMAND} -s overlay2" >> $DOCKER_STORAGE_CONFIG_FILE | |
systemctl daemon-reload | |
systemctl restart docker | |
systemctl status --full docker | |
#docker info | |
#rm -r /var/lib/docker/aufs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment