Configure Docker daemon
sudo cat << EOF > /etc/docker/daemon.json
{
"bip": "192.168.100.1/24",
"mtu": 1500,
"default-address-pools":[| # Author: Eric Pruitt (http://www.codevat.com) | |
| # License: 2-Clause BSD (http://opensource.org/licenses/BSD-2-Clause) | |
| # Description: This Makefile is designed to create a statically linked nginx | |
| # binary without any dependencies on the host system's version of glibc. | |
| NGINX_VERSION=1.15.0 | |
| OPENSSL_VERSION=1.0.2o | |
| PCRE_VERSION=8.42 | |
| ZLIB_VERSION=1.2.11 |
| ## Do this on each swarm-node | |
| # store containers attached to the bridge | |
| gwbridge_users=$(docker network inspect --format '{{range $key, $val := .Containers}} {{$key}}{{end}}' docker_gwbridge | xargs -d' ' -I {} -n1 docker ps --format {{.Names}} -f id={}) | |
| # stop all containers | |
| # if you have stacks that restart automatically, remove them via docker stack <stackName> rm | |
| echo "$gwbridge_users" | xargs docker stop | |
| docker network rm docker_gwbridge | |
| docker network disconnect -f docker_gwbridge ingress | |
| docker network rm docker_gwbridge |
| CmdUtils.CreateCommand({ | |
| name: "lmgtfy", | |
| synonyms: ["letmegooglethatforyou"], | |
| takes: {"words to google": noun_arb_text}, | |
| icon: "http://letmegooglethatforyou.com/favicon.ico", | |
| description: "Replaces the selected words with a <a href=\"http://www.tinyurl.com\">TinyUrl</a> of the <a href=\"\">Let Me Google That For You</a> link", | |
| preview: function( pblock, urlToShorten ){ | |
| pblock.innerHTML = "Replaces the selected URL with a tiny LMGTFY url."; | |
| var baseUrl = "http://tinyurl.com/api-create.php?url=http://letmegooglethatforyou.com/?q="; | |
| pblock.innerHTML = "Replaces the selected URL with ", |
| version: '3.8' | |
| services: | |
| # Database - Mongo DB | |
| mongo: | |
| image: mongo | |
| environment: | |
| MONGO_INITDB_ROOT_USERNAME: helpdev | |
| MONGO_INITDB_ROOT_PASSWORD: 123456 |
Just plug in your own values for registry and repo/image name.
registry='localhost:5000'
name='my-image'
curl -v -sSL -X DELETE "http://${registry}/v2/${name}/manifests/$(
curl -sSL -I \
-H "Accept: application/vnd.docker.distribution.manifest.v2+json" \| # These examples assume you have a container currently running. | |
| # 1 Pipe from a file | |
| sudo docker exec --interactive CONTAINER_NAME /bin/bash < the_beginning.sh | tee the_beginning_output.txt` | |
| #2a Pipe by piping | |
| echo "echo This is how we pipe to docker exec" | sudo docker exec --interactive CONTAINER_NAME /bin/bash - |
The following documents a trial of using etcd, and confd to automatically configure a haproxy load balancer.
It is built using a combination of blogs, resources and experimentation, but provides a rough template of the approach that would allow a fully featured balancer to be configured from etcd keyvalues.
| # -*- coding: utf-8 -*- | |
| import socket | |
| import os | |
| print("Connecting...") | |
| if os.path.exists("/tmp/python_unix_sockets_example"): | |
| client = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM) | |
| client.connect("/tmp/python_unix_sockets_example") | |
| print("Ready.") | |
| print("Ctrl-C to quit.") |
| #!/bin/bash | |
| ### BEGIN INIT INFO | |
| # Provides: zram | |
| # Required-Start: | |
| # Required-Stop: | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: Virtual Swap Compressed in RAM | |
| # Description: Virtual Swap Compressed in RAM | |
| ### END INIT INFO |