testing docker lxc script
This commit is contained in:
44
ubuntu/ubuntu-install-docker-lxc.sh
Executable file
44
ubuntu/ubuntu-install-docker-lxc.sh
Executable file
@@ -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 <<EOF >/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
|
||||
Reference in New Issue
Block a user