Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
# add docker repository
sudo apt install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
# install docker
sudo apt-get install -y docker-ce
# install docker-compose
COMPOSE_VERSION=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep 'tag_name' | cut -d\" -f4)
sudo curl -L https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo usermod -a -G docker $USER
# install docker-developer-dns
git clone https://github.com/BlackIkeEagle/docker-developer-dns.git $HOME/.docker-developer-dns
sudo cp $HOME/.docker-developer-dns/contrib/systemd/docker.developer-dns.service /etc/systemd/system/docker.developer-dns.service
sudo systemctl enable docker.developer-dns.service
sudo systemctl start docker.developer-dns.service
echo "DNS=127.0.0.1" | sudo tee -a /etc/systemd/resolved.conf
sudo systemctl restart systemd-resolved.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment