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
johnmccabe /
Last active Mar 28, 2019
Running OpenFaaS on Windows 10 - using Docker Swarm on Hyper-V
docker-machine create --driver hyperv --hyperv-virtual-switch ExternalSwitch registry
docker-machine ssh registry docker run -d -p 5000:5000 --restart=always --name registry registry:2
docker-machine ls # get the ip address of the VM, in this case
docker-machine create --driver hyperv --hyperv-virtual-switch ExternalSwitch --engine-insecure-registry swarm-1
docker-machine create --driver hyperv --hyperv-virtual-switch ExternalSwitch --engine-insecure-registry swarm-2
docker-machine create --driver hyperv --hyperv-virtual-switch ExternalSwitch --engine-insecure-registry swarm-3
docker-machine ssh swarm-1 docker swarm init  # copy the swarm join command to run on each other hose
docker-machine ssh swarm-2 docker swarm join --token SWMTKN-1-mysecrettoken
docker-machine ssh swarm-3 docker swarm join --token SWMTKN-1-mysecrettoken

Docker Swarm with Macvlan, Consul and Autoscaling


This will get you routable containers with IPs on your existing subnets, advertising to Consul. They will also be scalable and placed across a cluster of Swarm hosts. It's assumed that you are already running Consul, so if not, there are a ton of tutorials out there. It's also assumed you know how to install Docker and various Linux kernels.

Bonus: We add an autoscaling API called Orbiter (

I just want to run containers, like now, on my existing infrastructure and networks!

So you have an existing environment. You use Consul for service discovery. Life is good. Containers are now a thing and you want to work them in without having to worry about overlay networking or reverse proxies. You also don't want to add extra latency (as some naysayers could use it as fuel to kill your hopes and dreams). Lastly, you don't have a lot of time to invest in a complex orchestration tool, such a

View why-i'

I have been an aggressive Kubernetes evangelist over the last few years. It has been the hammer with which I have approached almost all my deployments, and the one tool I have mentioned (shoved down clients throats) in almost all my foremost communications with clients, and it was my go to choice when I was mocking my first startup (

A few weeks ago Docker 1.13 was released and I was tasked with replicating a client's Kubernetes deployment on Swarm, more specifically testing running compose on Swarm.

And it was a dream!

All our apps were already dockerised and all I had to do was make a few modificatons to an existing compose file that I had used for testing before prior said deployment on Kubernetes.

And, with the ease with which I was able to expose our endpoints, manage volumes, handle networking, deploy and tear down the setup. I in all honesty see no reason to not use Swarm. No mission-critical feature, or incredibly convenient really nice to have feature in Kubernetes that I'm go

kekru / Docker connect to remote
Last active Aug 21, 2019
Connect to another host with your docker client, without modifying your local Docker installation
View Docker connect to remote

Run commands on remote Docker host

This is how to connect to another host with your docker client, without modifying your local Docker installation or when you don't have a local Docker installation.

Enable Docker Remote API

First be sure to enable the Docker Remote API on the remote host.

This can easily be done with a container.
For HTTP connection use jarkt/docker-remote-api.
For HTTPS connection use kekru/docker-remote-api-tls.

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 Aug 11, 2019
Docker CLI Tips and Tricks
estesp /
Last active Aug 12, 2016
Ubuntu 16.04 / LXFS / Docker daemon + user namespaces clash

The Problem

See Docker issue #24834 for the more complete background. The short story is that if lxcfs is installed (which it is by default in Ubuntu 16.04) and you attempt to use the Docker daemon with user namespaces enabled, most likely you will end up with a confusing "container command could not be invoked error" like the one here:

# docker run --rm busybox date
docker: Error response from daemon: Container command 'date' could not be invoked..
BretFisher / .travis.yml
Created Feb 15, 2016
Travis-CI Docker Image Build and Push to AWS ECR
View .travis.yml
sudo: required #is required to use docker service in travis
language: php #can be any language, just php for example
- docker # required, but travis uses older version of docker :(
- echo "install nothing!" # put your normal pre-testing installs here
trebortech / notes
Created Feb 15, 2016
Salt the easy way
View notes
The following instructions will help you easily deploy out a SaltStack Master server with some basic settings.
Step 1.
Install docker on your machine where you want to run your SaltStack master. If you want to run this on Windows you could install virtualbox and deploy our a Linux VM that has docker installed on it. Additional network setup instructions are available upon request.
Step 2.
Confirm docker is installed and running correctly
xenophonf /
Last active Jun 27, 2017
GitHub webhook reactor for SaltStack
#### STATES/SALT/REACTOR/GITHUB.SLS --- Salt Reactor formula for GitHub webhooks
### Copyright (C) 2015 Matthew X. Economou <>
### Copyright (C) 2014, 2015 Carlos Jenkins <>
### Licensed under the Apache License, Version 2.0 (the "License");
### you may not use this file except in compliance with the License.
### You may obtain a copy of the License at
You can’t perform that action at this time.