Advertisement
webzaytsev

Untitled

Feb 22nd, 2023
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.67 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # This is for Ubuntu 22.04
  4. # set -euo pipefail
  5.  
  6. ########################
  7. ### SCRIPT VARIABLES ###
  8. ########################
  9. ### Be non-root user w/ sudo privileges.
  10.  
  11. # Name of the user to create and grant sudo privileges
  12.  
  13.  
  14. # Install docker
  15. sudo apt update
  16. sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
  17. curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
  18. echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  19. sudo apt update
  20. apt-cache policy docker-ce
  21. sudo apt install docker-ce -y
  22. sudo systemctl status docker
  23. sudo usermod -aG docker wz
  24.  
  25. ### Installs docker-compose
  26. sudo mkdir -p /usr/local/lib/docker/cli-plugins
  27.  
  28. sudo curl -L https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-linux-x86_64 -o /usr/local/lib/docker/cli-plugins/docker-compose
  29.  
  30. sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
  31.  
  32. ### Installs compose-switch
  33. sudo curl -fL https://github.com/docker/compose-switch/releases/download/v1.0.5/docker-compose-linux-amd64 -o /usr/local/bin/compose-switch
  34.  
  35. sudo chmod +x /usr/local/bin/compose-switch
  36.  
  37. ### update-alternatives --install /usr/local/bin/docker-compose docker-compose <PATH_TO_DOCKER_COMPOSE_V1> 1
  38. sudo update-alternatives --install /usr/local/bin/docker-compose docker-compose /usr/local/bin/compose-switch 99
  39. sudo update-alternatives --display docker-compose
  40.  
  41. docker network create caddy
  42. mkdir lab
  43. cd lab
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement