Skip to content

Instantly share code, notes, and snippets.

All Day Containers!

Bret Fisher BretFisher

All Day Containers!
View GitHub Profile
BretFisher / docker-compose.yml
Created Nov 10, 2017
Docker Compose local development with wildcard DNS for multi-domain development
View docker-compose.yml
version: '3'
# is a wildcard domain that resolves to localhost
# in case you need to pass URL's around from browser to
# containers this could help you get around localhost problem
# use to access web containter from host
# use to access api container from host
BretFisher / Dockerfile
Last active Sep 9, 2021
WIP sample Laravel php_fpm plus nginx plus supervisor Docker setup with npm, composer, bower, and more
View Dockerfile
FROM yourdockername/base-php-nginx:latest AS build
# the primary reason we have two build stages is so SSH key of private repo's will never
# be in final image
# It won't be copied to final image
# add this build arg to compose file
RUN if [ -z "$BUILDKEY" ]; then echo "BUILDKEY SSH NOT SET - ERROR"; exit 1; else : ; fi
BretFisher /
Last active Aug 11, 2021
On macOS: Install pygmentize and alias pcat for shell code syntax highlighting
# first install pygmentize to the mac OS X or macOS system with the built-in python
sudo easy_install Pygments
# then add alias to your ~/.bash_profile or ~/.bashrc or ~/.zshrc etc.
alias pcat='pygmentize -f terminal256 -O style=native -g'
BretFisher /
Last active Feb 28, 2018
Docker Cloud Swarm Connect Alias
# so docker cloud now has swarms fleet mgmt
# and you can use something like this to connect from cli to your swarm via docker remote api:
docker run --rm -ti -v /var/run/docker.sock:/var/run/docker.sock -e DOCKER_HOST dockercloud/client bretfisher/swarm1
# but maybe we can put that in a bash alias to make it easier
alias cswarm="docker run --rm -ti -v /var/run/docker.sock:/var/run/docker.sock -e DOCKER_HOST dockercloud/client"
cswarm bretfisher/dude-swarm1
BretFisher /
Last active Jun 14, 2021
Simple Apache + Nginx Reverse Proxy Example in Docker Compose
  1. download these two files to the same directory
  2. docker-compose up
  3. http://localhost should show you "it works" which is apache being reverse-proxied through nginx
  4. docker sets up DNS for web based on compose service name so the nginx front-end can find http://web
  5. proxy is set to listen on public port 80 on host so it'll receive incoming traffic, then push to httpd
BretFisher / config-check-log.txt
Created Feb 27, 2017
Linux Mint 18.1 Serena Docker Config Check
View config-check-log.txt
warning: /proc/config.gz does not exist, searching other paths for kernel config ...
info: reading kernel config from /boot/config-4.4.0-64-generic ...
Generally Necessary:
- cgroup hierarchy: properly mounted [/sys/fs/cgroup]
- apparmor: enabled, but apparmor_parser missing
(use "apt-get install apparmor" to fix this)
- CONFIG_NET_NS: enabled
- CONFIG_PID_NS: enabled
BretFisher / .tmux.conf
Created Feb 25, 2017
My ugly tmux config, much copied from others and tweaked
View .tmux.conf
# tmux config for ultimate winning
# make tmux display things in 256 colors
#set -g default-terminal "screen-256color"
# use this if italic enabled in term profile
set -g default-terminal "tmux-256color"
# set just true color without custom term
#set -ga terminal-overrides ",xterm-256color:Tc"
# fixes bug:
#set -ga terminal-overrides ',xterm*:sitm=\E[3m'
BretFisher /
Last active Nov 14, 2021
Getting a Shell in the Docker Desktop Mac VM

2021 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info:

BretFisher / present.zsh-theme
Last active Mar 24, 2021
oh-my-zsh theme for presentations (hides prompt features based on path)
View present.zsh-theme
# problem: when presenting, I want to obscure
# my prompt to act like it's at root of file system
# and be very basic with no git info, etc.
# solution: this theme lets you set a ENV to the path
# of your presentation, which will help remove unneeded prompt
# features while in that path
# oh-my-zsh theme for presenting demos
# based off the default rubbyrussell theme


HR Analysis, by team Spectre

  • Web visualizations of HR road accident data using Google Maps and D3 over the last 5 years
  • Data from github, not sure of source

NOAH, by team Haxton

  • Map visualizations of "overflow incidents" of storm and sewer processing systems
  • Some data from, some from HRSD, but didn't all line up to their desired data around nitrogen content due to overflow.