Last active
August 16, 2019 05:28
-
-
Save nguyenl95/1134575efce8e496e5a46d598976c348 to your computer and use it in GitHub Desktop.
linux quick and dirty scripts
This file contains 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
sudo sed -ie 's/\([a-zA-Z0-9]*\.archive\.\)\{0,1\}\(archive\.\)\{0,1\}\(security\.\)\{0,1\}ubuntu\.com/opensource\.xtdv\.net/g' /etc/apt/sources.list |
This file contains 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
set -x | |
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose | |
# if the box is Red hat based | |
# sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose |
This file contains 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
set -x | |
# pre docker | |
sudo apt-get update | |
sudo apt-get install -y \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
gnupg-agent \ | |
software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo apt-key fingerprint 0EBFCD88 | |
sudo add-apt-repository \ | |
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) \ | |
stable" | |
# install docker | |
sudo apt-get update | |
sudo apt-get install -y docker-ce docker-ce-cli containerd.io | |
# test docker | |
sudo docker run hello-world |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment