- 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.
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
| // Pattern Specification | |
| // | |
| // In the following example, we are retrieving invoices and sending them to a collection agency if | |
| // 1. they are overdue, | |
| // 2. notices have been sent, and | |
| // 3. they are not already with the collection agency. | |
| // This example is meant to show the end result of how the logic is 'chained' together. | |
| // | |
| // This usage example assumes a previously defined OverdueSpecification class | |
| // that is satisfied when an invoice's due date is 30 days or older, |
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 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 | |
| WORKDIR /tmp | |
| ADD https://deb.nodesource.com/setup_6.x nodesource_setup.sh | |
| RUN sudo bash nodesource_setup.sh \ | |
| && sudo apt-get install -y nodejs build-essential \ | |
| && sudo rm -rf /var/lib/apt/lists/* |
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
| sudo: required #is required to use docker service in travis | |
| language: php #can be any language, just php for example | |
| services: | |
| - docker # required, but travis uses older version of docker :( | |
| install: | |
| - echo "install nothing!" # put your normal pre-testing installs here |
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 && \ |
NewerOlder