Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tiero/7dea98a869174accb4edd7e31e19e170 to your computer and use it in GitHub Desktop.
Save tiero/7dea98a869174accb4edd7e31e19e170 to your computer and use it in GitHub Desktop.
A simple Docker and Docker Compose install script for Ubuntu

A simple Docker and Docker Compose install script for Ubuntu

Usage

  1. sh install-docker.sh
  2. log out
  3. log back in
  4. Run docker compose
version: '3'
services:
# LND Testnet
lnd:
volumes:
- lnd-data:/lnd
container_name: lnd-node
ports:
- 10009:10009
- 9735:9735
image: lnzap/lnd:latest
command:
- --bitcoin.active
- --bitcoin.testnet
- --debuglevel=info
- --bitcoin.node=neutrino
- --neutrino.connect=testnet1-btcd.zaphq.io
- --neutrino.connect=testnet2-btcd.zaphq.io
- --neutrino.connect=faucet.lightning.community
- --neutrino.connect=testnet.vulpem.com
- --autopilot.active
- --rpclisten=0.0.0.0:10009
- --tlsextraip=${IP}
restart: unless-stopped
volumes:
lnd-data:
external: false
#!/bin/sh
set -eu
# Docker
sudo apt update \
&& sudo apt --yes --no-install-recommends install \
apt-transport-https \
ca-certificates \
&& wget --quiet --output-document=- https://download.docker.com/linux/ubuntu/gpg \
| sudo apt-key add - \
&& sudo add-apt-repository \
"deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/ubuntu \
$(lsb_release --codename --short) \
stable" \
&& sudo apt update \
&& sudo apt --yes --no-install-recommends install docker-ce \
&& sudo usermod --append --groups docker "$USER" \
&& sudo systemctl enable docker \
&& printf '\nDocker installed successfully\n\n'
printf 'Waiting for Docker to start...\n\n'
sleep 3
sudo usermod -a -G docker $USER
# Docker Compose
sudo apt update
sudo apt install -y python
sudo apt install -y python-pip
sudo pip install docker-compose
printf '\nDocker Compose installed successfully\n\n'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment