Skip to content

Instantly share code, notes, and snippets.

Bret Fisher BretFisher

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
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:
# https://github.com/robbyrussell/oh-my-zsh/blob/master/templates/zshrc.zsh-template
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
COMPLETION_WAITING_DOTS="true"
@BretFisher
BretFisher / docker-alias.sh
Created Apr 22, 2018
Docker Alias common stuff, mostly from oh-my-zsh
View docker-alias.sh
dcb='docker-compose build'
dcdn='docker-compose down'
dce='docker-compose exec'
dcl='docker-compose logs'
dclf='docker-compose logs -f'
dco=docker-compose
dcps='docker-compose ps'
dcr='docker-compose run'
dcrestart='docker-compose restart'
dcrm='docker-compose rm'
@BretFisher
BretFisher / docker-for-windows.md
Last active Sep 16, 2019
Getting a Shell in the Docker for Windows Moby VM
View docker-for-windows.md

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

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

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

more info: https://github.com/justincormack/nsenter1

@BretFisher
BretFisher / swarm-upgrade.md
Last active Apr 11, 2019
docker swarm upgrade
View swarm-upgrade.md

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
@BretFisher
BretFisher / # et - 2017-12-13_05-58-36.txt
Created Dec 13, 2017
et (mistertea/et/et) on macOS 10.13.2 - Homebrew build logs
View # et - 2017-12-13_05-58-36.txt
Homebrew build logs for mistertea/et/et on macOS 10.13.2
Build date: 2017-12-13 05:58:36
@BretFisher
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'
# vcap.me 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
services:
# use www.vcap.me to access web containter from host
# use api.vcap.me to access api container from host
proxy:
@BretFisher
BretFisher / Dockerfile
Last active Feb 5, 2019
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
# BUILD STAGE
# the primary reason we have two build stages is so SSH key of private repo's will never
# be in final image
# COPY IN BUILD SSH KEY
# It won't be copied to final image
# add this build arg to compose file
ARG BUILDKEY
RUN if [ -z "$BUILDKEY" ]; then echo "BUILDKEY SSH NOT SET - ERROR"; exit 1; else : ; fi
@BretFisher
BretFisher / pcat-install.sh
Last active Sep 9, 2019
On macOS: Install pygmentize and alias pcat for shell code syntax highlighting
View pcat-install.sh
# 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
BretFisher / alias.sh
Last active Feb 28, 2018
Docker Cloud Swarm Connect Alias
View alias.sh
# 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"
#then
cswarm bretfisher/dude-swarm1
@BretFisher
BretFisher / README.md
Last active Jan 25, 2019
Simple Apache + Nginx Reverse Proxy Example in Docker Compose
View README.md
  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
You can’t perform that action at this time.