• DevOps安装、部署持续集成


    1、重启docker服务,开启iptables转发功能

    # systemctl start docker

    # vi /etc/sysctl.conf 

    # sysctl -p

    [root@localhost ~]# systemctl start docker
    [root@localhost ~]# 
    [root@localhost ~]# vi /etc/sysctl.conf 
    # System default settings live in /usr/lib/sysctl.d/00-system.conf.
    # To override those settings, enter new settings here, or in an /etc/sysctl.d/<name>.conf file
    #
    # For more information, see sysctl.conf(5) and sysctl.d(5).
    net.ipv4.ip_forwerd=1
    net.ipv4.conf.default.rp_filter=0
    net.ipv4.conf.all.rp_filter=0

    [root@localhost ~]#
    [root@localhost ~]# sysctl -p
    sysctl: cannot stat /proc/sys/net/ipv4/ip_forwerd: No such file or directory
    net.ipv4.conf.default.rp_filter = 0
    net.ipv4.conf.all.rp_filter = 0
    [root@localhost ~]#

    2、拉去镜像

    (1)、拉取gogs和mysql的镜像到本地

    # docker pull gogs/gogs:latest

    [root@localhost ~]# docker pull gogs/gogs:latest
    latest: Pulling from gogs/gogs
    cd784148e348: Pull complete 
    f0e1b639074f: Pull complete 
    e71af6f4a6ad: Pull complete 
    a64b4ab49da6: Pull complete 
    efab18b5c706: Pull complete 
    17399ed4c107: Pull complete 
    b7b418729010: Pull complete 
    c82ba2f905fb: Pull complete 
    6cab86c6d6d0: Pull complete 
    ba110a57d653: Pull complete 
    Digest: sha256:a2aa44992d2a520647f625c32bd6ccdfc8fbb5703baf5c5eedec98deda5c42a4
    Status: Downloaded newer image for gogs/gogs:latest
    [root@localhost ~]# 

     # docker pull mysql:latest

    [root@localhost ~]# docker pull mysql:latest
    latest: Pulling from library/mysql
    177e7ef0df69: Pull complete 
    cac25352c4c8: Pull complete 
    8585afabb40a: Pull complete 
    1e4af4996053: Pull complete 
    c326522894da: Pull complete 
    9020d6b6b171: Pull complete 
    55eb37ec6e5f: Pull complete 
    37f3f3d72fbd: Pull complete 
    03f098d64268: Pull complete 
    46a52a54cfe9: Pull complete 
    202bc662895d: Pull complete 
    46014f07b258: Pull complete 
    Digest: sha256:196c04e1944c5e4ea3ab86ae5f78f697cf18ee43865f25e334a6ffb1dbea81e6
    Status: Downloaded newer image for mysql:latest
    [root@localhost ~]# 

     # docker images

    [root@localhost ~]# docker images
    mysql                                                  latest              102816b1ee7d        2 weeks ago         486MB
    gogs/gogs                                              latest              5fc13abdcbd5        3 weeks ago         93.8MB

     (2)、启动gogs容器和mysql容器

    # docker run -d -p 81:3000 --name gogs gogs/gogs:latest

    # docker run -d -p 13306:3306 -e MYSQL_ROOT_PASSWORD=000000 --name gogs-mysql mysql:latest

    3、创建数据库

    (1)、进入mysql容器,创建gogs数据库

    # docker exec -it gogs-mysql /usr/bin/mysql -uroot -p000000

    mysql> create database gogs;

     mysql> show databases;

     mysql> exit

    (2)、在网页上登录gogs服务,配置数据库连接地址、用户、密码等参数

    关闭防火墙

    在浏览器中输入:

    http://192.168.100.117:81

    注册登录后

    (5)、复制git库到本地/opt目录,构建私有仓库

    # yum install git -y

    # git clone http://192.168.100.117:81/djl/djl.git

  • 相关阅读:
    Java 中Timer和TimerTask 定时器和定时任务使用的例子
    PowerDesigner逆向工程导入MYSQL数据库总结
    Powerdesigner 连接mysql 在指定的DSN中,驱动程序和应用程序之间的体系结构不匹配 SQLSTATE = IM014
    关于web.xml中的<welcome-file-list>
    SQL查询四舍五入 解决方法
    HTML页面跳转的5种方法
    easyUI datagrid 列宽自适应(简单 图解)(转)
    navicat for mysql只导出数据表结构(转)
    每一位想有所成就的程序员都必须知道的15件事(走不一样的路,要去做,实践实践再实践,推销自己,关注市场)good
    2017除夕夜的感悟:学习工作不分家,工作生活不分家,读书用兵不分家
  • 原文地址:https://www.cnblogs.com/djlsunshine/p/10282720.html
Copyright © 2020-2023  润新知