Skip to content

Instantly share code, notes, and snippets.

@OtherDevOpsGene
Last active October 30, 2020 14:58
Show Gist options
  • Save OtherDevOpsGene/15a03e603c543f3a5e22169cba9122c6 to your computer and use it in GitHub Desktop.
Save OtherDevOpsGene/15a03e603c543f3a5e22169cba9122c6 to your computer and use it in GitHub Desktop.
Script to set up workstation for the Docker workshop
#! /bin/bash
# To set up an Ubuntu system as we used in the Docker tutorial,
# copy this script the the target system and run it as root:
# sudo bash ./docker-workshop.sh
# If you want to allow username/password log in, you may need to edit /etc/ssh/sshd_config
# Change
# PasswordAuthentication no
# to
# PasswordAuthentication yes
# You'll also need the following ports open:
# * 22 for SSH traffic
# * 80, 4444, and 8080 open for HTTP traffic
# Prerequisite software for Docker
apt-get update
apt-get install -y apt-transport-https ca-certificates curl software-properties-common
# Use the Docker repository directly for the latest and greatest version
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt-get update
# Install Docker Community Edition and the Redis command-line interface
apt-get install -y docker-ce redis-tools
# Install Docker Compose (but not the Ubuntu package that requires an X11 display)
curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
# Give the default ubuntu user permission to use Docker
usermod -a -G docker ubuntu
# If you aren't using an AWS image with the ubuntu user, just replace the username with
# the appropriate user or users on your system
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment