From 934bb3ff2eb69872b19f4d466ea7bea7a4022372 Mon Sep 17 00:00:00 2001 From: akanealw Date: Thu, 4 Apr 2024 11:44:46 -0500 Subject: [PATCH] testing docker lxc script --- ubuntu/ubuntu-install-docker-lxc.sh | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 ubuntu/ubuntu-install-docker-lxc.sh diff --git a/ubuntu/ubuntu-install-docker-lxc.sh b/ubuntu/ubuntu-install-docker-lxc.sh new file mode 100755 index 0000000..8d7fad3 --- /dev/null +++ b/ubuntu/ubuntu-install-docker-lxc.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +if [ "$EUID" -ne 0 ] + then + echo "Please run as root" + exit +fi + +if [[ ! -f /etc/apt/keyrings/docker.gpg ]] + then + apt-get update && apt-get upgrade -y + apt-get install -y fuse-overlayfs + curl -fsSL https://get.docker.com | sh + mkdir /home/akanealw/docker + chown -R akanealw:akanealw /home/akanealw/docker + adduser akanealw docker + systemctl enable docker.service + systemctl enable containerd.service + systemctl start docker.service + systemctl start containerd.service + cat </etc/docker/daemon.json + { + "storage-driver": "fuse-overlayfs" + } + EOF + systemctl restart docker.service + curl -s https://raw.githubusercontent.com/jesseduffield/lazydocker/master/scripts/install_update_linux.sh | bash + mv /root/.local/bin/lazydocker /usr/local/bin + echo "alias dc='docker compose'" >> /etc/bash.bashrc + echo "alias dcup='docker compose up -d'" >> /etc/bash.bashrc + echo "alias dcdown='docker compose down'" >> /etc/bash.bashrc + echo "alias dcpull='docker compose pull'" >> /etc/bash.bashrc + echo "alias dps='docker ps'" >> /etc/bash.bashrc + echo "alias dstart='docker start'" >> /etc/bash.bashrc + echo "alias dstop='docker stop'" >> /etc/bash.bashrc + echo "alias drestart='docker restart'" >> /etc/bash.bashrc + echo "alias dlf='docker logs -f'" >> /etc/bash.bashrc + echo "alias dipaf='docker image prune -a -f'" >> /etc/bash.bashrc + echo "alias deit='docker exec -it'" >> /etc/bash.bashrc + echo "alias lzd='lazydocker'" >> /etc/bash.bashrc + echo "Docker installed successfully." + else + echo "Docker is already configured." +fi