Last active
September 23, 2021 18:03
-
-
Save laurobmb/31535db298f973b4d455808f02a05e8c to your computer and use it in GitHub Desktop.
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
| #!/bin/bash | |
| function InstallDocker(){ | |
| apt-get update | |
| apt-get -y install apt-transport-https ca-certificates curl gnupg lsb-release | |
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg | |
| echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null | |
| apt-get update | |
| apt-get -y install docker-ce docker-ce-cli containerd.io | |
| } | |
| function InstallCompose(){ | |
| curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
| chmod +x /usr/local/bin/docker-compose | |
| ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose | |
| docker-compose --version | |
| } | |
| # how to execute script | |
| # bash <(curl -s URL ) | |
| # bash <(curl -s https://gist.githubusercontent.com/laurobmb/31535db298f973b4d455808f02a05e8c/raw/1400922048043e0dada126df4f7f518827b6c32d/InstallDockerUbuntu.sh ) | |
| InstallDocker | |
| InstallCompose | |
| docker run hello-world |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment