This file contains 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
$cat containerpilot.json | |
{ | |
"consul": "localhost:8500", | |
"preStart": "/app/manage.sh prestart", | |
"services": [ | |
{ | |
"name": "api", | |
"health": "/usr/bin/curl -o /dev/null --fail -s http://localhost/health", | |
"poll": 3, | |
"ttl": 10, |
This file contains 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
# ON NODE1 | |
docker@node1:~$ docker swarm init | |
Error response from daemon: could not choose an IP address to advertise since this system has multiple addresses on different interfaces | |
(10.0.2.15 on eth0 and 192.168.99.100 on eth1) - specify one with --advertise-addr | |
# Let's go with eth1 to use the 192.168.99.100 IP | |
docker@node1:~$ docker swarm init --advertise-addr eth1 | |
Swarm initialized: current node (jnrkaduxwe31imlpps068234f) is now a manager. |
This file contains 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
$ curl --unix-socket /var/run/docker.sock http://localhost/events | |
{ | |
"status": "create", | |
"id": "277786a066994b4d842dc097c4544e2ddcf50ffe0b6aa8352812ca0aadec4078", | |
"from": "nginx", | |
"Type": "container", | |
"Action": "create", | |
"Actor": { | |
"ID": "277786a066994b4d842dc097c4544e2ddcf50ffe0b6aa8352812ca0aadec4078", | |
"Attributes": { |
This file contains 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
$ docker run -it --pid=host --privileged debian:jessie nsenter -t 1 -m -p -n | |
27d43a83b9f9:/# cat /etc/docker/daemon.json | jq | |
{ | |
"debug": true, | |
"experimental": true, | |
"metrics-addr": "0.0.0.0:9999" | |
} |
This file contains 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
$ docker run -it --pid=host --privileged debian:jessie nsenter -t 1 -m -p -n | |
f1e84d54cad5:/# ip a show docker0 | |
14: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP | |
link/ether 02:42:78:1e:f9:7f brd ff:ff:ff:ff:ff:ff | |
inet 172.17.0.1/16 scope global docker0 | |
valid_lft forever preferred_lft forever | |
inet6 fe80::42:78ff:fe1e:f97f/64 scope link | |
valid_lft forever preferred_lft forever | |
f1e84d54cad5:/# |
This file contains 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
$ cat /tmp/prom.yml | |
global: | |
scrape_interval: 5s | |
external_labels: | |
monitor: 'local-monitor' | |
# A scrape configuration containing exactly one endpoint to scrape: | |
scrape_configs: | |
- job_name: 'Docker4Mac' | |
static_configs: |
This file contains 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
$ docker container ls | |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
4bc4e9bad2ee 46.101.7.50/admin/www "nginx -g 'daemon ..." 2 days ago Up 2 days 80/tcp node-03/www.1.6t4gzcd0fckm0khtc7o4d3tjc | |
0c2a255a2e2d docker/dtr-postgres:2.2.4 "/bin/postgreswrapper" 2 days ago Up 2 days 5432/tcp node-02/dtr-scanningstore-6bf1cb947a68 | |
7fc4a2925aba docker/dtr-notary-signer:2.2.4 "/init --skip-runi..." 2 days ago Up 2 days 80/tcp, 443/tcp, 3000/tcp node-02/dtr-notary-signer-6bf1cb947a68 | |
446a9ab1bb3d docker/dtr-jobrunner:2.2.4 "/init --skip-runi..." 2 days ago Up 2 days 80/tcp, 443/tcp, 3000/tcp |
This file contains 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
# Cloning the repository | |
$ git clone git@github.com:lucj/iot-api.git | |
Cloning into 'iot-api'... | |
remote: Counting objects: 64, done. | |
remote: Total 64 (delta 0), reused 0 (delta 0), pack-reused 64 | |
Receiving objects: 100% (64/64), 9.57 KiB | 0 bytes/s, done. | |
Resolving deltas: 100% (27/27), done. | |
Checking connectivity... done. | |
# Go into project's folder |
This file contains 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
$ cat /tmp/dump-20170517T130624 | |
Entry Index=1, Term=1, Type=EntryConfChange: | |
Conf change type: ConfChangeAddNode | |
Node ID: 13594650fea96624 | |
Entry Index=2, Term=2, Type=EntryNormal: | |
Entry Index=3, Term=2, Type=EntryNormal: | |
id: 101251685852929 | |
action: < | |
action: STORE_ACTION_CREATE | |
cluster: < |
This file contains 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
$ diff dump-20170517T130624 dump-20170517T131442 | |
678a679,1133 | |
Entry Index=11, Term=2, Type=EntryNormal: | |
id: 101251685852937 | |
action: < | |
action: STORE_ACTION_CREATE | |
node: < | |
id: “nvajg1fm52nd2hx80xlwqzo1f” | |
meta: < | |
version: < |