Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
for i in 1 2 3 4 5 6 7 8 9 10
do
docker service create --name nginx --replicas 3 -p 80 nginx:mainline-alpine
sleep 5
docker service scale nginx=2
sleep 5
docker service scale nginx=7
sleep 5
docker service scale nginx=1
Linux ubuntu 3.19.0-25-generic #26~14.04.1-Ubuntu SMP
Server Version: 1.12.1-cs1-rc2
3 nodes running as VM on Fedora 23 4.6.6-200.fc23.x86_64 #1 SMP with KVM
docker service create --name nginx --replicas 4 -p 80 nginx:mainline-alpine
node 1: 1 replica
node 2: 1 replica
node 3: 2 replicas
@adrahon
adrahon / gist:3ac2d2d62093732b209b50f8d2f72c9c
Created June 22, 2016 21:56 — forked from kolyshkin/gist:bd25e9de97954b330d8a
How to run go pprof on Docker daemon
Enable port 8080 through the firewall:
firewall-cmd --add-port=8080/tcp
Run socat to make docker sock available via tcp port (note the IP to listen at)
socat -d -d TCP-LISTEN:8080,fork,bind=192.168.122.214 UNIX:/var/run/docker.sock
Run pprof on your client:
go tool pprof http://192.168.122.214:8080/debug/pprof/profile
Fetching profile from http://192.168.122.214:8080/debug/pprof/profile
Please wait... (30s)
version: "2"
services:
voting-app:
image: docker/example-voting-app-voting-app
ports:
- "80"
networks:
- voteapp
result-app:

Keybase proof

I hereby claim:

  • I am adrahon on github.
  • I am adrahon (https://keybase.io/adrahon) on keybase.
  • I have a public key whose fingerprint is 1CB5 6FE2 1F07 8CA2 AABC 08A2 EBE4 FF98 C6D1 8369

To claim this, I am signing this object:

@adrahon
adrahon / gist:725d68a9350038176b97
Created December 11, 2014 13:59
fabric8 selinux error
type=AVC msg=audit(1418306273.338:3452): avc: denied { write } for pid=6553 comm="logspout" name="docker.sock" dev="tmpfs" ino=307704 scontext=system_u:system_r:svirt_lxc_net_t:s0:c129,c870 tcontext=system_u:object_r:docker_var_run_t:s0 tclass=sock_file permissive=0
type=SYSCALL msg=audit(1418306273.338:3452): arch=c000003e syscall=42 success=no exit=-13 a0=3 a1=c20804e690 a2=13 a3=0 items=0 ppid=23948 pid=6553 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="logspout" exe="/bin/logspout" subj=system_u:system_r:svirt_lxc_net_t:s0:c129,c870 key=(null)