Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // To install
- dockerVersion=$(curl -sL https://download.docker.com/linux/static/stable/x86_64 | grep -ioP '\d\d\.\d\.\d' | sort -rV | head -n 1)
- composeVersion=$(curl -sL https://api.github.com/repos/docker/compose/releases | grep -ioP 'v\d\.\d\d\.\d' | sort -rV | head -n 1)
- DOCKER_CONFIG=/root/.docker
- wget https://download.docker.com/linux/static/stable/x86_64/docker-$dockerVersion.tgz
- gunzip docker-$dockerVersion.tgz
- tar xvf docker-$dockerVersion.tar
- mv docker/* /usr/bin
- rm -r docker*
- mkdir -p $DOCKER_CONFIG/cli-plugins
- wget https://github.com/docker/compose/releases/download/$composeVersion/docker-compose-linux-x86_64 -O $DOCKER_CONFIG/cli-plugins/docker-compose
- chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
- cat << EOF > /etc/systemd/system/docker.service
- [Unit]
- Description=Docker
- After=network.target
- Wants=network-online.target
- [Service]
- Restart=always
- Type=simple
- ExecStart=/usr/bin/dockerd
- WorkingDirectory=
- Environment=
- [Install]
- WantedBy=multi-user.target
- EOF
- systemctl enable docker
- systemctl start docker
- // To uninstall
- systemctl stop docker
- rm /etc/systemd/system/docker.service
- systemctl daemon reload
- rm /usr/bin/containerd /usr/bin/containerd-shim-runc-v2 /usr/bin/ctr /usr/bin/docker /usr/bin/dockerd /usr/bin/docker-init /usr/bin/docker-proxy /usr/bin/log /usr/bin/runc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement