qdyxmas's Room

Done is better than perfect...

单测docker化安装

单测docker化安装

封装依赖顺序

ubuntu=>jenkins=>python38=>依赖包(apt-get + 源码包)

依次封装依赖包

1. ubuntu 18.04:
    查看ubuntu 具有的镜像版本https://hub.docker.com/_/ubuntu?tab=tags&page=1&ordering=last_updated
    1.1 拉取ubuntu 18.04版本的docker镜像
        docker pull ubuntu:18.04  a7fa45fb43d471f4e66c5b53b1b9b0e02f7f1d37a889a41bbe1601fac70cb54e
    1.2 运行ubuntu docker镜像
        docker images 获取镜像id
        docker  run  -dit  --name=xkool_ubuntu   镜像id /bin/bash
    1.3 查看容器后进入容器
        docker ps -a
        docker  exec  -it  xkool_ubuntu  /bin/bash
    1.4 进入容器后安装java + jenkins环境,进入到下面的第二步
2. 在ubuntu上封装jenkins和python包,以及各个服务的dockerfileDeps里面的源码和第三方依赖包,安装完成以后打成xkool_unittest_deps镜像
    2.1.  python包的安装
        wget https://www.python.org/ftp/python/3.8.5/Python-3.8.2.tar.xz
        tar -xvJf Python-3.8.5.tar.xz
        cd Python-3.8.5/
        ./configure prefix=/usr/local/python38
        make
        make install
        ln -s /usr/local/python3/bin/python3 /usr/bin/python
        ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
    2.2   jenkins环境安装
          2.2.1 sudo apt-get install openjdk-8-jdk 安装java
          2.2.2 参考链接
                https://www.cnblogs.com/yangzp/p/12953810.html
                https://www.cnblogs.com/yjlch1016/p/8900841.html
    2.3   apt-get 依赖包安装
    2.4   源码包的安装(具体安装包见服务器DockerfileDeps文件)

    2.5   对已经安装好的环境打包
        root@xkool:~# docker ps
        CONTAINER ID   IMAGE          COMMAND       CREATED        STATUS        PORTS     NAMES
        bbf96ca4532d   2c047404e52d   "/bin/bash"   19 hours ago   Up 19 hours             xkool_ubuntu
        root@xkool:~# docker stop bbf96ca4532d
        bbf96ca4532d
        root@xkool:~# docker ps -a
        CONTAINER ID   IMAGE          COMMAND       CREATED        STATUS                     PORTS     NAMES
        bbf96ca4532d   2c047404e52d   "/bin/bash"   19 hours ago   Exited (0) 6 seconds ago             xkool_ubuntu
        root@xkool:~# 
        root@xkool:~# docker commit 61371241a1a7 xkool_py_jenkins
        docker save -o xkool_py_jenkins.tar
        调试运行
        docker run -it -p 8081:8080 -v /data:/data --privileged=true xkool_unittest_deps_timestamp /bin/bash

3. 编写单测需要使用的依赖和第三方包,基础镜像使用xkool_unittest_deps,最后运行得到单测环境

18 评论

  1. ZdaRJ
    /回复

    Medicament information. What side effects? <a href="https://lyrica24x7.top">rx prekabalin</a> in US Some about medicament. Read here.

  2. JaniceWeS
    /回复

    cialis and lisinopril <a href="https://mycialistabs.com/">what is cialis for</a> cialis side effects a wife's perspective

  3. TiffanyreD
    /回复

    cialis generic cost <a href="https://toptadalafiltabs.com/">cialis for daily use</a> cialis without a doctor prescription usa

  4. Stellavam
    /回复

    how to write an introduction for an argumentative essay <a href="https://topessaywriterfas.com/">buy essay online</a> how to write a website title in an essay

  5. RebeccaMew
    /回复

    custom service essay <a href="http://writemyessayslfd.com/">write college essays for money</a> what to write a persuasive essay on

  6. FrancesHix
    /回复

    viagra connect usa <a href="https://mrviagrashop.com">viagra para mujeres</a> mexican viagra

  7. Martinanulse
    /回复

    viagra for womens where to buy <a href="https://mysildenafilkr.com/">sildenafil online canada</a> viagra 200mg

  8. ZujXQ
    /回复

    full stack developer resume <a href="http://coverletterforresumetop.com/">best resume sites</a> resume scanner

  9. Kathryngogue
    /回复

    cialis coupon cvs <a href="http://tadalafilled.com/">cialis no prescription</a> cialis goodrx

  10. VojAO
    /回复

    child care resume <a href="https://writingacoverletteronline.com/">resume and linkedin services</a> teacher assistant resume

  11. OtyKA
    /回复

    sildenafil citrate 100mg <a href="https://edviagramaster.net/">viagra over the counter</a> natural viagra

  12. KvxRC
    /回复

    goodrx viagra <a href="https://sildenafilviagratop.com">viagra</a> woman viagra

  13. VtiNZ
    /回复

    generic for cialis <a href="https://cialisortadalafil.com/">purchasing cialis online</a> no prescription cialis

  14. BdrYB
    /回复

    is cialis generic <a href="https://topcialistabs.com/">maxim peptide tadalafil</a> cialis side effect

  15. ZmyVI
    /回复

    <a href="https://krasota4u.ru">can you get generic trazodone</a>

  16. WocNZ
    /回复

    Drugs information leaflet. Long-Term Effects. <a href="https://plaquenil4people.top">where to buy cheap plaquenil</a> in the USA Actual what you want to know about drug. Read here.

  17. CharlesVex
    /回复

    “I haven’t seen you in these parts,” the barkeep said, sidling during to where I sat. “Designation’s Bao.” He stated it exuberantly, as if say of his exploits were shared aside settlers about multitudinous a ‚lan in Aeternum. He waved to a wooden butt hard by us, and I returned his gesture with a nod. He filled a field-glasses and slid it to me across the stained red wood of the excluding in the vanguard continuing. “As a betting chains, I’d be willing to wager a fair bit of silver you’re in Ebonscale Reach for more than the carouse and sights,” he said, eyes glancing from the sword sheathed on my with it to the bend slung across my back. https://www.google.iq/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&ved=0CDAQFjAB&url=https://renewworld.ru/data-vyhoda-new-world/

  18. CharlesVex
    /回复

    “I haven’t seen you in these parts,” the barkeep said, sidling over and above to where I sat. “Designation’s Bao.” He stated it exuberantly, as if word of his exploits were shared aside settlers around many a fire in Aeternum. He waved to a unanimated butt upset us, and I returned his gesticulate with a nod. He filled a glass and slid it to me across the stained red wood of the excluding before continuing. “As a betting man, I’d be delighted to wager a above-board portion of coin you’re in Ebonscale Reach for more than the carouse and sights,” he said, eyes glancing from the sword sheathed on my cool to the bow slung across my back. http://www.google.so/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0ccsqfjaa&url=https://renewworld.ru/sistemnye-trebovaniya-new-world/

评论