- Bash/zsh completion
- use Tab to populate command line, narrows down options as you go, fills in container names, ID's, images, volumes. Huge time saver.
Starting with 1.12, Docker Swarm Mode is a built-in solution with built-in key/value store. Easier to get started, and fewer ports to configure.
- TCP port 2377 for cluster management & raft sync communications
- TCP and UDP port 7946 for "control plane" gossip discovery communication
- UDP port 4789 for "data plane" VXLAN overlay network traffic
AWS Tip: You should use Security Groups in AWS's "source" field rather then subnets, so SG's will all dynamically update when new nodes are added.
- download these two files to the same directory
- docker-compose up
- http://localhost should show you "it works" which is apache being reverse-proxied through nginx
- docker sets up DNS for
webbased on compose service name so the nginx front-end can find http://web - proxy is set to listen on public port 80 on host so it'll receive incoming traffic, then push to httpd
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #option 1: copy and paste this into ssh to install docker engine | |
| # NOTE: update --label=owner=YOURNAME below if you want to easily identify yours | |
| apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D && \ | |
| mkdir -p /etc/apt/sources.list.d && \ | |
| echo deb https://apt.dockerproject.org/repo ubuntu-xenial main > /etc/apt/sources.list.d/docker.list && \ | |
| printf 'net.ipv4.neigh.default.gc_thresh1 = 30000\nnet.ipv4.neigh.default.gc_thresh2 = 32000\nnet.ipv4.neigh.default.gc_thresh3 = 32768' >> /etc/sysctl.conf && \ | |
| sysctl -p && \ | |
| service lxcfs stop && apt-get remove -y -q lxc-common lxcfs lxd lxd-client && \ | |
| apt-get update -q && apt-get install -y -q linux-image-extra-$(uname -r) linux-image-extra-virtual && \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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: https://github.com/tmux/tmux/issues/435 | |
| #set -ga terminal-overrides ',xterm*:sitm=\E[3m' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @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 bret@bretfisher.com | |
| REM also find this info and more in a blog article at http://www.fishbrains.com/2015/01/29/untitled/ | |
| REM Origional Steps (identical to this): http://support.microsoft.com/kb/971058 | |
| REM This file Copyright MIT License | |
| REM Stop Services |