当前位置:网站首页>Efficiency improvement - encourage personalized container development environment
Efficiency improvement - encourage personalized container development environment
2022-07-01 22:46:00 【mariolu】
The background is that our company has a complex project , This project cites 27 Time submodule, use cicd The development efficiency of test environment is very slow , because cicd The clean-up space before construction is opened on , Every compilation is a huge amount git Pulling process , compile cache Will also be emptied together , So do a compilation , Twenty or thirty minutes passed , And it may only take 20 or 30 minutes to solve a development compilation error . Time is not worth the loss .
One 、Dockerfile Description file
So I had an idea . on-line cicd According to this docker Description file compiled
In vernacular, this description file ,
- Go online to download a centos7.4 Mirror image ,
- Package the compiled program in the directory zip Files in /data/app/approot Under the table of contents ,
- yum Install some allowed or necessary packages
- Then execute some subsequent commands .
Two 、 Create a mirror image image
Well, according to this document , Execute the following command
sudo docker build -t fullfish/toucan -f ./Dockerfile .
-f It specifies Dockerfile The path of ,-t Represents generated image name ,
If these steps are successful , And then you can use it docker image ls Check the just packed image
3、 ... and 、 Start the mirror
And start this image,sudo docker run -d --rm -it --entrypoint bash fullfish/toucan
Then you can use docker container ls Check this startup container example .
And then you can use it id perhaps names Enter this container,sudo docker exec -it 3bd8d0b98146 bash
perhaps sudo docker exec -it silly_spence bash
And then this container Inside , We put the engineering code git download , In addition, complete the whole compilation environment . For example, my project
These necessary third-party components are missing ,
One of the more interesting things is libstdc++-static, This bag is actually very hidden , Because my code is statically compiled libstdc++, So even if there is libstdc++.so No way . This missing error will be reported in the code linkbase stage . The other is gcc-c++, This is actually centos7 Of gcc4.8 edition .
In this way, the image package is based on offline cicd Environmental Science centos7 The image package includes these necessary packages and gcc4.8 development environment .
Four 、 according to container Generate a new image
Well, I'm here too Dockerfile Improved some dependency library information . Next I'm going to put this image Share with colleagues , How to do it . That is to say, make this perfect container generating image. Then colleagues can according to this new image Make their own development environment .
use docker commit Submit this id,
sudo docker commit 3bd8d0b98146
And then use docker tag Generate a memorable name
sudo docker tag 6e939bf3a45b toucan_dev
Then colleagues can happily use the new image toucan_dev 了 , Use this image package to enter docker Development , You don't have to rely on cicd Compile and debug on
边栏推荐
猜你喜欢
随机推荐
Gaussdb (DWS) active prevention and troubleshooting
隐藏用户的创建和使用
Basic knowledge of ngnix
旅游管理系统
20220701
JVM有哪些类加载机制?
固定资产管理子系统报表分为什么大类,包括哪些科目
Chapter 9 Yunji datacanvas company has been ranked top 3 in China's machine learning platform market
Relationship and difference between enterprise architecture and project management
There is no signal in HDMI in computer games caused by memory, so it crashes
Chen Tianqi's machine learning compilation course (free)
[literacy] deep / shallow, local / global features in machine learning image processing
Appium自动化测试基础 — 补充:Desired Capabilities参数介绍
Mysql——》Innodb存储引擎的索引
Resttemplate remote call tool class
性能测试计划怎么编写
Mysql——》MyISAM存储引擎的索引
91.(cesium篇)cesium火箭发射模拟
Configure filter
CSDN购买的课程从哪里可以进入