Skip to content

Instantly share code, notes, and snippets.

DockerCon LIVE 2020 is coming!

Bret Fisher BretFisher

DockerCon LIVE 2020 is coming!
Block or report user

Report or block BretFisher

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
BretFisher / .zshrc
Created Jul 4, 2018
my custom oh-my-zsh setup
View .zshrc
# this assumes your using oh-my-zsh for maximum zsh-ness
# info and defaults are here:
export LC_ALL="en_US.UTF-8"
export ZSH=/Users/bret/.oh-my-zsh
# custom prompt theme
ZSH_THEME="present" # mine is present, default is robbyrussell, also agnoster, fishy, ys, wild-cherry
BretFisher / present.zsh-theme
Last active Mar 25, 2020
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
BretFisher / Dockerfile
Last active Jan 20, 2020
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 / repair-windows-update.bat
Last active Jan 18, 2020
Reset Windows Update components RE: KB971058
View repair-windows-update.bat
@echo off
REM Automation of Steps to Reset Windows Updates
REM Tested on Server 2012 R2, likely works on everything Win7/2008R2 and up
REM by Bret Fisher
REM also find this info and more in a blog article at
REM Origional Steps (identical to this):
REM This file Copyright MIT License
REM Stop Services
BretFisher /
Created Oct 31, 2019
Scary Course Sale for Halloween
BretFisher /
Created Feb 8, 2016
Mac Update/Cleanup Script
# store the current dir
# Update App Store apps
sudo softwareupdate -i -a
# Update Homebrew (Cask) & packages
brew update
BretFisher / Dockerfile-selenium-nodejs
Created Nov 17, 2016
Dockerfile selenium with nodejs
View Dockerfile-selenium-nodejs
FROM selenium/standalone-chrome
# lets install node 6.x then cleanup
# install build-essential and leave in case npm needs it
# we have to sudo because selenium defaults to seluser
RUN sudo bash \
&& sudo apt-get install -y nodejs build-essential \
&& sudo rm -rf /var/lib/apt/lists/*
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 /
Last active May 6, 2019
Install Docker PPA on Ubuntu 16.04
# NOT FOR SHELL SCRIPT, but rather just for quick copy paste
# this is a copy-paste version with defaults of the full shell script which is below this one in gist.
apt-get -y install apt-transport-https ca-certificates curl && \
curl -fsSL | sudo apt-key add - && \
add-apt-repository "deb [arch=amd64] $(lsb_release -cs) stable" && \
service lxcfs stop && apt-get remove -y -q lxc-common lxcfs lxd lxd-client && \
apt-get update -q && \
apt-get install -y -q docker-ce && \
printf '{ "userns-remap" : "default" , "storage-driver" : "overlay2" }' > /etc/docker/daemon.json && \
BretFisher /
Last active Apr 11, 2019
docker swarm upgrade

Replace your Swarm Manager and Workers with updated versions of docker

  • it's best to replace nodes, don't do apt/yum upgrades.
  • both would work, but VM replacment forces me to think of it as immutable and prevents making pets
  • if you don't want to update join scripts for manager IP's, then do something like Elastic IP's so manager IP's won't change.

Lets assume you have 3 managers and 3 workers on 17.06 and you want to update to 17.12

  • managers: m1, m2, m3
You can’t perform that action at this time.