Skip to content

Instantly share code, notes, and snippets.

@davidmyersdev
Last active September 19, 2016 21:04
Show Gist options
  • Select an option

  • Save davidmyersdev/9e7c027345e659089aabfad2a5b9d311 to your computer and use it in GitHub Desktop.

Select an option

Save davidmyersdev/9e7c027345e659089aabfad2a5b9d311 to your computer and use it in GitHub Desktop.
An opinionated script to automate the setup process for the Windows Subsystem for Linux.
DOCKER_HOST="tcp://192.168.99.101:2376"
DOCKER_MACHINE_NAME="docker"
DOCKER_TLS_VERIFY="1"
DOCKER_CERT_PATH="/mnt/c/Users/david/.docker/machine/machines/docker"
#/usr/bin/env bash
# this file will configure the Windows Subsystem for Linux image based on my preferences
# -- config options -- #
# load our config from the .env file
export $(cat .env | xargs)
# -- provisioning -- #
# update package list
sudo apt-get -qq update
# make sure apt is using https
sudo apt-get -qq install apt-transport-https ca-certificates
# add docker gpg key
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
# add docker package for this version of ubuntu
echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
# update package list with new docker packages
sudo apt-get update
# install the docker package (we only need the docker cli, but it comes prebundled with docker-engine at the moment)
sudo apt-get install docker-engine
# add docker config to our ~/.profile
echo "DOCKER_HOST=${DOCKER_HOST}" > ~/.profile
echo "DOCKER_MACHINE_NAME=${DOCKER_MACHINE_NAME}" > ~/.profile
echo "DOCKER_TLS_VERIFY=${DOCKER_TLS_VERIFY}" > ~/.profile
echo "DOCKER_CERT_PATH=${DOCKER_CERT_PATH}" > ~/.profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment