Skip to content

Instantly share code, notes, and snippets.

@jensklose
Last active August 16, 2019 00:24
Show Gist options
  • Save jensklose/c18bf8e319f9a65d85b5077f0ed6458b to your computer and use it in GitHub Desktop.
Save jensklose/c18bf8e319f9a65d85b5077f0ed6458b to your computer and use it in GitHub Desktop.
Inital provision of an ubuntu 18.04 host with git and docker
#!/bin/bash
# This system should run ONLY:
#
# git - to handle version control for system files
# docker - to handle ALL services
#
apt-get update || exit 1
if [ -z "`which git`" ]; then
echo "install git"
apt-get install -y --no-install-recommends git
fi
if [ -z "`which docker`" ]; then
echo "install docker"
apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
apt-get update
apt-get install -y --no-install-recommends docker-ce docker-ce-cli
fi
if [ -z "`which docker-compose`" ]; then
echo "install docker-compose"
curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment