executable_my-docker 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. #!/bin/sh
  2. # oleg@guixsd ~$ docker swarm init
  3. # Swarm initialized: current node (w0mml9jb9wydvk41f7nfw7f1f) is now a manager.
  4. # To add a worker to this swarm, run the following command:
  5. # docker swarm join --token SWMTKN-1-0vie91jdas5hytn9z5ku376ax6v8u1pqkfrnvf60qz7k8r6rgd-ekto8dik2zcn2acnhlnc3c4q5 192.168.105.120:2377
  6. # To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.
  7. influxdb()
  8. {
  9. docker run \
  10. --name influxdb \
  11. --hostname influxdb \
  12. --net=influxdb \
  13. --detach \
  14. --restart unless-stopped \
  15. --env 'INFLUXDB_ADMIN_ENABLED=true' \
  16. --volume /var/lib/influxdb:/var/lib/influxdb \
  17. --volume /etc/influxdb/influxdb.conf:/etc/influxdb/influxdb.conf:ro \
  18. influxdb
  19. }
  20. telegraf()
  21. {
  22. docker run \
  23. --name telegraf \
  24. --net=influxdb \
  25. --hostname telegraf \
  26. --detach \
  27. --restart unless-stopped \
  28. --env HOST_PROC=/host/proc \
  29. --volume /proc:/host/proc:ro \
  30. --volume "$HOME"/src/hello-telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro \
  31. telegraf
  32. }
  33. kapacitor()
  34. {
  35. docker run \
  36. --name kapacitor \
  37. --net=influxdb \
  38. --publish 9092:9092 \
  39. --hostname kapacitor \
  40. -e KAPACITOR_INFLUXDB_0_URLS_0=http://influxdb:8086 \
  41. --detach \
  42. --restart unless-stopped \
  43. --env HOST_PROC=/host/proc \
  44. --volume /proc:/host/proc:ro \
  45. --volume "$HOME"/src/hello-kapacitor/kapacitor.conf:/etc/kapacitor/kapacitor.conf:ro \
  46. kapacitor
  47. }
  48. chronograf()
  49. {
  50. docker run \
  51. --name chronograf \
  52. --net=influxdb \
  53. --hostname chronograf \
  54. --detach \
  55. --restart unless-stopped \
  56. --volume /var/lib/chronograf:/var/lib/chronograf \
  57. chronograf
  58. }
  59. influxdb()
  60. {
  61. docker run \
  62. --name influxdb \
  63. --hostname influxdb \
  64. --network host \
  65. --detach \
  66. --restart unless-stopped \
  67. --env 'INFLUXDB_ADMIN_ENABLED=true' \
  68. --publish 8083:8083 \
  69. --publish 8086:8086 \
  70. --volume /var/lib/influxdb:/var/lib/influxdb \
  71. --volume /etc/influxdb/influxdb.conf:/etc/influxdb/influxdb.conf:ro \
  72. influxdb -config /etc/influxdb/influxdb.conf
  73. }
  74. telegraf()
  75. {
  76. docker run \
  77. --name telegraf \
  78. --hostname guixsd \
  79. --detach \
  80. --restart unless-stopped \
  81. --env HOST_PROC=/host/proc \
  82. --volume /proc:/host/proc:ro \
  83. --volume "$HOME"/src/hello-telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro \
  84. telegraf
  85. }
  86. kapacitor()
  87. {
  88. docker run \
  89. --name kapacitor \
  90. --hostname kapacitor \
  91. --detach \
  92. --restart unless-stopped \
  93. --env HOST_PROC=/host/proc \
  94. --volume /proc:/host/proc:ro \
  95. --volume "$HOME"/src/hello-kapacitor/kapacitor.conf:/etc/kapacitor/kapacitor.conf:ro \
  96. --publish 9092:9092 \
  97. kapacitor
  98. }
  99. chronograf()
  100. {
  101. docker run \
  102. --name chronograf \
  103. --hostname guixsd \
  104. --detach \
  105. --restart unless-stopped \
  106. --publish 8888:8888 \
  107. --volume /var/lib/chronograf:/var/lib/chronograf \
  108. --add-host influxdb:172.17.0.1 \
  109. chronograf --influxdb-url=http://influxdb:8086
  110. }
  111. grafana()
  112. {
  113. docker run \
  114. --name grafana \
  115. --hostname grafana \
  116. --detach \
  117. --restart unless-stopped \
  118. --net=influxdb \
  119. --user 30020:0 \
  120. --publish 3080:3000 \
  121. --volume /var/lib/grafana:/var/lib/grafana \
  122. --mount type=bind,source=/etc/localtime,target=/etc/localtime,readonly \
  123. -e "GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-simple-json-datasource,alexanderzobnin-zabbix-app" \
  124. grafana/grafana
  125. }
  126. elasticsearch()
  127. {
  128. docker run \
  129. --name elasticsearch \
  130. --detach \
  131. --restart unless-stopped \
  132. --volume /var/lib/elasticsearch/data:/usr/share/elasticsearch/data \
  133. --volume /srv/elk/backup:/mnt/backup \
  134. --volume /etc/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
  135. --publish 9200:9200 \
  136. --publish 9300:9300 \
  137. docker.elastic.co/elasticsearch/elasticsearch:6.5.1
  138. }
  139. filebeat()
  140. {
  141. docker run \
  142. --name filebeat \
  143. --detach \
  144. --add-host elasticsearch:192.168.105.120 \
  145. --restart unless-stopped \
  146. --mount type=bind,source=/etc/filebeat/filebeat.yml,target=/usr/share/filebeat/filebeat.yml \
  147. --mount type=bind,source=/var/log,target=/mnt/log,readonly \
  148. --mount type=bind,source=/etc/localtime,target=/etc/localtime,readonly \
  149. --hostname guixsd \
  150. docker.elastic.co/beats/filebeat:6.5.1 -e -strict.perms=false -E output.elasticsearch.hosts=["elasticsearch:9200"] -E name="guixsd"
  151. }
  152. kibana()
  153. {
  154. docker run \
  155. --name kibana \
  156. --detach \
  157. --restart unless-stopped \
  158. --publish 5601:5601 \
  159. --mount type=bind,source=/etc/kibana/kibana.yml,target=/usr/share/kibana/config/kibana.yml \
  160. docker.elastic.co/kibana/kibana:6.5.1
  161. }
  162. logstash()
  163. {
  164. docker run \
  165. --name logstash \
  166. --hostname logstash \
  167. --network host \
  168. --add-host elasticsearch:192.168.105.120 \
  169. --detach \
  170. --restart unless-stopped \
  171. --volume "$HOME/src/hello-elk/logstash/":/usr/share/logstash/pipeline/ \
  172. docker.elastic.co/logstash/logstash:6.5.1
  173. }
  174. elastalert()
  175. {
  176. docker run \
  177. --detach \
  178. --restart unless-stopped \
  179. -v "$HOME/src/elastalert/config/elastalert.yaml:/opt/elastalert/config.yaml" \
  180. -v "$HOME/src/elastalert/config/config.json:/opt/elastalert-server/config/config.json" \
  181. -v "$HOME/src/elastalert/rules:/opt/elastalert/rules" \
  182. -v "$HOME/src/elastalert/rule_templates:/opt/elastalert/rule_templates" \
  183. --network host \
  184. --name elastalert \
  185. --hostname elastalert \
  186. bitsensor/elastalert:2.0.1
  187. }
  188. gitlab()
  189. {
  190. docker run \
  191. --restart unless-stopped \
  192. --hostname gitlab \
  193. --add-host gitlab.wugi.info:127.0.0.1 \
  194. --add-host smtp:172.17.0.1 \
  195. --name gitlab \
  196. --detach \
  197. --publish 65080:80 \
  198. --publish 65022:22 \
  199. --publish 65090:9090 \
  200. --volume /etc/gitlab:/etc/gitlab \
  201. --volume /var/log/gitlab:/var/log/gitlab \
  202. --volume /var/lib/gitlab:/var/opt/gitlab \
  203. gitlab/gitlab-ce:11.10.0-ce.0
  204. }
  205. gitlab_monitor()
  206. {
  207. docker run \
  208. --name gitlab-monitor \
  209. --detach \
  210. --restart unless-stopped \
  211. --publish 64680:80 \
  212. timoschwarzer/gitlab-monitor:latest
  213. }
  214. jenkins()
  215. {
  216. docker run \
  217. --name jenkins \
  218. --hostname jenkins \
  219. --detach \
  220. --restart unless-stopped \
  221. --user 30018:30004 \
  222. --volume /home/jenkins:/var/jenkins_home \
  223. --publish 30080:8080 \
  224. --publish 50000:50000 \
  225. jenkins/jenkins:lts
  226. }
  227. registry()
  228. {
  229. docker run \
  230. --name registry \
  231. --hostname registry \
  232. --detach \
  233. --restart unless-stopped \
  234. --publish 5000:5000 \
  235. --volume /var/lib/docker-registry:/var/lib/registry \
  236. registry:2
  237. }
  238. malscan()
  239. {
  240. docker run \
  241. --name malscan \
  242. --detach \
  243. --interactive \
  244. --publish 48080:8080 \
  245. --volume /home/oleg/src/malscan:/var/www \
  246. localhost:5000/malscannew
  247. }
  248. malscan_db()
  249. {
  250. docker run \
  251. --name malscan-db \
  252. --detach \
  253. --interactive \
  254. --publish 3306:3306 \
  255. --volume /var/lib/mysql:/var/lib/mysql \
  256. --env MYSQL_ROOT_PASSWORD='' \
  257. mariadb:5.5
  258. }
  259. phpmyadmin()
  260. {
  261. docker run \
  262. --name phpmyadmin \
  263. --detach \
  264. --link malscan-db:db \
  265. --publish 49080:80 \
  266. phpmyadmin/phpmyadmin
  267. }
  268. alerta()
  269. {
  270. docker run \
  271. --name alerta \
  272. --detach \
  273. --add-host db:172.17.0.1 \
  274. --publish 47080:8080 \
  275. --mount type=bind,source=/etc/localtime,target=/etc/localtime,readonly \
  276. --mount type=bind,source=/home/oleg/src/hello-alerta/alertad.conf,target=/app/alertad.conf,readonly \
  277. --env DEBUG=1 \
  278. --env DATABASE_URL=postgres://alerta:alerta@db:5432/alerta \
  279. --env AUTH_REQUIRED=True \
  280. --env ADMIN_USERS=admin@localhost \
  281. --env PLUGINS=reject,blackout,normalise,enhance,slack \
  282. --env INSTALL_PLUGINS=normalise,enhance,slack \
  283. --restart unless-stopped \
  284. alerta/alerta-web:7.4.1
  285. }
  286. tor()
  287. {
  288. docker run \
  289. --name tor \
  290. --detach \
  291. --publish 8118:8118 \
  292. --publish 9051:9050 \
  293. rdsubhas/tor-privoxy-alpine
  294. }
  295. redmine()
  296. {
  297. docker run \
  298. --restart unless-stopped \
  299. --detach \
  300. --name redmine \
  301. --publish 44080:3000 \
  302. --env REDMINE_DB_POSTGRES=192.168.105.120 \
  303. --env REDMINE_DB_USERNAME=redmine \
  304. --env REDMINE_DB_PASSWORD=redmine \
  305. redmine:4.0.4
  306. }
  307. znc()
  308. {
  309. docker run --name znc --restart=unless-stopped -d -p 8060:8060 -v /var/lib/znc:/znc-data:Z znc:1.8.2-slim
  310. }
  311. # alias firefox_java='xhost + ; docker run -ti --rm --name firefox-java -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix cmaohuang/firefox-java'
  312. tome4()
  313. {
  314. docker-xorg -v /srv/share/tome4:/install --network=host --rm -u0: -w /opt/tome4 --hostname tome4 --name tome4 -e DISPLAY=:0 -v /opt/tome4:/opt/tome4 -v /opt/tome4/rootfs/home/user:/root -v /home/oleg/.t-engine:/root/.t-engine tome4:latest bash
  315. }
  316. paws()
  317. {
  318. docker run --volume "${HOME}/Maildir/slack-ihc-default:/home/user/Maildir/slack-ihc-default" --volume "${HOME}/Maildir/slack-ihc-bounce:/home/user/Maildir/slack-ihc-bounce" --volume "${HOME}/.paws:/home/user/.paws" --name paws --network=host paws paws-receive
  319. }
  320. paws-majordomo()
  321. {
  322. docker run --volume "${HOME}/Maildir/slack-majordomo-default:/home/user/Maildir/slack-majordomo-default" --volume "${HOME}/Maildir/slack-majordomo-bounce:/home/user/Maildir/slack-majordomo-bounce" --volume "${HOME}/.paws-majordomo/config:/home/user/.paws/config" --name paws-majordomo --network=host paws
  323. }