Skip to content

Instantly share code, notes, and snippets.

Docker Cheat Sheet

Why

Why Should I Care (For Developers)

"Docker interests me because it allows simple environment isolation and repeatability. I can create a run-time environment once, package it up, then run it again on any other machine. Furthermore, everything that runs in that environment is isolated from the underlying host (much like a virtual machine). And best of all, everything is fast and simple."

TL;DR, I just want a dev environment

# Copyright 2012 Erlware, LLC. All Rights Reserved.
#
# This file is provided to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file
# except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
#!/bin/bash
sudo apt-get update
sudo apt-get -y install linux-image-extra-$(uname -r)
sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -"
sudo sh -c "echo deb http://get.docker.io/ubuntu docker main\ > /etc/apt/sources.list.d/docker.list"
sudo apt-get update
sudo apt-get -y install lxc-docker
@ferrouswheel
ferrouswheel / README.md
Created October 7, 2015 23:12 — forked from clhenrick/README.md
PostgreSQL & PostGIS cheatsheet (a work in progress)
@ferrouswheel
ferrouswheel / readme.md
Created October 8, 2015 03:14
PostgreSQL FDW w/ PostGIS Support

FDW w/ PostGIS

The PostgreSQL native FDW (foreign data wrapper), postgres_fdw allows you to access tables from remote PostgreSQL servers very transparently, even doing thoughtful things like pushing restrictions to the remote server to reduce the amount of data transferred and ensure work is done close to the data.

Out of the box, the standard PostgreSQL FDW also allows PostGIS geometry to transit from remote to local hosts, which is pretty cool.

However, it will not push spatial restrictions from the local host to the remote host, only restrictions that relate to built-in types. I've done a rough and ready patch to the 9.4 branch to allow spatial restrictions to pass over FDW, and it is available here:

@ferrouswheel
ferrouswheel / 1_install_cuda.sh
Last active December 17, 2015 03:39 — forked from graphific/1_install_cuda.sh
Installation script for Cuda and drivers on Ubuntu 14.04
#!/usr/bin/env bash
set -e
# Installation script for Cuda and drivers on Ubuntu 14.04, by Roelof Pieters (@graphific)
# BSD License
if [ "$(whoami)" == "root" ]; then
echo "running as root, please run as user you want to have stuff installed as"
exit 1
fi
@ferrouswheel
ferrouswheel / 2_test_gpu_cuda.sh
Last active December 17, 2015 03:39 — forked from graphific/2_test_gpu_cuda.sh
Test script for checking if Cuda and Drivers correctly installed on Ubuntu 14.04
#!/usr/bin/env bash
set -e
# Test script for checking if Cuda and Drivers correctly installed on Ubuntu 14.04, by Roelof Pieters (@graphific)
# BSD License
if [ "$(whoami)" == "root" ]; then
echo "running as root, please run as user you want to have stuff installed as"
exit 1
@ferrouswheel
ferrouswheel / 3_install_deeplearning_libs.sh
Last active December 17, 2015 04:33 — forked from graphific/3_install_deeplearning_libs.sh
Installation script for Deep Learning Libraries on Ubuntu 14.04
#!/usr/bin/env bash
# Installation script for Deep Learning Libraries on Ubuntu 14.04, by Roelof Pieters (@graphific)
# BSD License
orig_executor="$(whoami)"
if [ "$(whoami)" == "root" ]; then
echo "running as root, please run as user you want to have stuff installed as"
exit 1
fi
###################################
#!/usr/bin/env python
# gpu_stat.py [DELAY [COUNT]]
# dump gpu stats as a line of json
# {"time": 1474168378.146957, "pci_tx": 146000, "pci_rx": 1508000,
# "gpu_util": 42, "mem_util": 24, "mem_used": 11710,
# "temp": 76, "fan_speed": 44 }
@ferrouswheel
ferrouswheel / Install NVIDIA Driver and CUDA.md
Created November 23, 2016 02:56 — forked from wangruohui/Install NVIDIA Driver and CUDA.md
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora