记录常用的简易docker镜像

consul

docker run -d --name=dev-consul -p 8500:8500 consul

skywalking7

地址:https://github.com/apache/skywalking-docker

version: '3'
services:
  elasticsearch:
    #image: docker.elastic.co/elasticsearch/elasticsearch:6.5.4
    image: elasticsearch:6.5.4
    container_name: elasticsearch
    restart: always
    ports:
      - 9200:9200
    environment:
      discovery.type: single-node
    ulimits:
      memlock:
        soft: -1
        hard: -1
  oap:
    image: apache/skywalking-oap-server:7.0.0-es6
    container_name: oap
    restart: always
    ports:
      - 11800:11800
      - 12800:12800
    environment:
      SW_STORAGE: elasticsearch
      SW_STORAGE_ES_CLUSTER_NODES: elasticsearch:9200
      TZ: Asia/Shanghai
  ui:
    image: apache/skywalking-ui:7.0.0
    container_name: ui
    depends_on:
      - oap
    links:
      - oap
    restart: always
    ports:
      - 8080:8080
    environment:
      SW_OAP_ADDRESS: oap:12800

docker-compose -f 对应文件 up -d

apollo

参考:https://github.com/ctripcorp/apollo/wiki/Apollo-Quick-Start-Docker%E9%83%A8%E7%BD%B2

nexus

docker run -d --name nexus -p 8085:8081 -p 8086:8086 -p 5000:5000 -v nexus_data:/nexus-data sonatype/nexus3:latest

prometheus

docker run  -d \
  -p 9090:9090 \
  prom/prometheus

grafana

docker run -d \
  -p 3000:3000 \
  --name=grafana \
  grafana/grafana

gitlab

mkdir -p /d/gitlab/etc && mkdir -p /d/gitlab/log && mkdir -p /d/gitlab/data && docker run --privileged=true --detach --publish 8443:443 --publish 8090:80 --name gitlab --restart unless-stopped -v /d/gitlab/etc:/etc/gitlab -v /d/gitlab/log:/var/log/gitlab -v /d/gitlab/data:/var/opt/gitlab beginor/gitlab-ce:11.0.1-ce.0 

修改/d/gitlab/etc/gitlab.rb
把external_url改成部署机器的域名或者IP地址(千万不要带端口)

vi /d/gitlab/etc/gitlab.rb
将external_url 'http://部署机器的ip地址'

5.修改/d/gitlab/data/gitlab-rails/etc/gitlab.yml

vi /d/gitlab/data/gitlab-rails/etc/gitlab.yml
找到关键字 * ## Web server settings *
将host的值改成映射的外部主机ip地址和端口(8089),这个ip端口影响你的项目克隆地址的ip和端口,必须是映射的外部
ip和端口。

进如容器内部重启(注意不是使用docker restart)

[root@node etc]# docker exec -it 8a4f9c8efed5 bash    
root@8a4f9c8efed5:/# gitlab-ctl restart
ok: run: alertmanager: (pid 4347) 0s
ok: run: gitaly: (pid 4356) 0s
ok: run: gitlab-monitor: (pid 4369) 1s
ok: run: gitlab-workhorse: (pid 4384) 0s
ok: run: logrotate: (pid 4395) 1s
ok: run: nginx: (pid 4401) 0s
ok: run: node-exporter: (pid 4486) 0s
ok: run: postgres-exporter: (pid 4493) 1s
ok: run: postgresql: (pid 4503) 0s
ok: run: prometheus: (pid 4512) 1s
ok: run: redis: (pid 4523) 0s
ok: run: redis-exporter: (pid 4550) 1s
ok: run: sidekiq: (pid 4567) 0s
ok: run: sshd: (pid 4570) 0s
ok: run: unicorn: (pid 4586) 0s

sentinel-dashboard

  docker run -d -p 8001:8001 -e DASHBOARD_SERVER_PASSWORD=1234567 liaomin789/sentinel-dashboard:1.8.0

xxljob

docker中运行
`docker run --host -e PARAMS="--spring.datasource.url=jdbc:mysql://192.168.20.20:3307/xxl-job?Unicode=true&characterEncoding=UTF-8 --spring.datasource.username=root --spring.datasource.password=db@12345 --xxl.job.logretentiondays=30" -p 8180:8080 --name xxl-job-admin  -d xuxueli/xxl-job-admin:2.0.1


swarm中创建(注意--network需要加上,否则在其他项目中通过xxl-job-admin:8080无法访问)
docker service create --name xxl-job-admin --network=gvt_network  -e PARAMS="--spring.datasource.url=jdbc:mysql://192.168.20.20:3307/xxl-job?Unicode=true&characterEncoding=UTF-8 --spring.datasource.username=root --spring.datasource.password=db@12345 --xxl.job.logretentiondays=30" -p 8180:8080  -d xuxueli/xxl-job-admin:2.0.1``

rabbitmq

docker run -d -p 5672:5672 -p 15672:15672 --name rabbitmq rabbitmq:management

logstash

docker run -d  -p 5044:5044 --name logstash logstash:7.14.2

配置文件:/usr/share/logstash/pipeline/logstash.conf

input {
    tcp {
    port => 5044
    codec => "json_lines"
    }
}
filter{
      if [level] == "ERROR" {
	      #将appname的值copy到appname_tmp,注意copy指令必须在独立的mutate中
	      mutate{
		    copy => { "appname" => "appname_tmp" }
		  }
		  #切割当前这个字段,注意字段本省也会变成数组,比如appname_tmp=a_b 经过split后 appname_tmp=[a,b]
		  mutate{
			split => {"appname_tmp" => "_"}
			#将数组的第一个和第二值设置到新的变量中,移除临时产生的数组
			add_field => {
					"projectName" => "%{[appname_tmp][0]}"
					"env" => "%{[appname_tmp][1]}"
			}
			remove_field => [ "appname_tmp" ]
		  }
	  }
}
output {
      if [level] == "ERROR" {  
          #输出到es中	  
	      elasticsearch {
            action => "index"
            hosts => ["192.168.20.48:9200"]
            index => "%{[appname]}-%{+YYYY.MM.dd}-error"
		  }
		  #调用钉钉推送
          http {
            url => "https://oapi.dingtalk.com/robot/send?access_token=3bc2c7e1c52c71edfe079b15cc87c562215b4712564b5144808f81869xxxxxxxx"
			http_method => "post"
			content_type => "application/json; charset=utf-8"
			format => "message"
			message => '{"msgtype":"text","at":{"atMobiles":["13537647253","13143458887"]},"text":{"content":"错误告警:项目:%{[projectName]},在环境:%{[env]}出现异常,异常信息:%{[message]}"}}'
		  }
		  #调用邮件发送
		  email {
			port => 25
			address => "smtp.exmail.qq.com"
			username => "app@jieztech.com"
			password => "xxxxxx"
			authentication => "plain"
			contenttype => "text/html; charset=UTF-8"
			from => "app@jieztech.com"
			subject => "错误告警:项目:%{[projectName]},在环境:%{[env]}出现异常"
			to => "liaomin@jieztech.com"
			use_tls => false
			via => "smtp"
			body => "错误告警:项目:%{[projectName]},在环境:%{[env]}出现异常,异常信息:%{[message]}"
		  }
      }else{
		 elasticsearch {
           action => "index"
           hosts => ["192.168.20.48:9200"]
           index => "%{[appname]}-%{+YYYY.MM.dd}"   
         }	
	  }
}

es

docker run --name elasticsearch --net host -e "discovery.type=single-node" elasticsearch:6.5.4

redis

docker run -name redis -p 6379:6379 -v $PWD/data:/data  -d redis:3.2 redis-server --appendonly yes
执行客户端
docker exec -it redis redis-cli

openproject

docker run -d -p 80:80 --name openproject   -e OPENPROJECT_HOST__NAME=project.xxx.com   -e OPENPROJECT_SECRET_KEY_BASE=secret   -e OPENPROJECT_HTTPS=false   -v /var/lib/openproject/pgdata:/var/openproject/pgdata   -v /var/lib/openproject/assets:/var/openproject/assets   liaomin789/openproject_e:12

注意OPENPROJECT_HOST__NAME指向的域名指向你的docker的主机,或者直接指定docker主机对应的ip

mongodb

docker run -it -v D:/datavolumn/mongo:/data/db/mongo --restart=always -p 27017:27017 --name mongodb -d mongo:4.4.19

mysql

docker run -d -p 3307:3306 --name mysql -v D:/datavolumn/mysql/my.cnf:/etc/mysql/my.cnf -v D:/datavolumn/mysql/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 -e MYSQL_DATABASE=mydb -e MYSQL_USER=liaomin -e MYSQL_PASSWORD=123456 mysql
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值