
5

基于底包创建新的镜像
source link: https://kalifun.github.io/2021/03/30/ji-yu-di-bao-chuang-jian-xin-de-jing-xiang/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

基于底包创建新的镜像
由于项目依赖了OpenCV对图像进行处理,而且项目都是采用Docker部署的。目前公司提供的镜像仓库都没有可用的包,所以只能自己修改。
docker image pull xxx/xxx/xxxx/xxx:latest
先查看镜像是否下载成功:
docker image ls
docker run xxx/xx/xxxx-public:latest /bin/bash
安装OpenCV
sudo yum install -y cmake gcc
wget https://github.com/opencv/opencv/archive/4.5.1.zip
unzip 4.5.1.zip
解压安装包
cd opencv-4.5.1
创建build目录
mkdir build
进入 build 目录
cd build
设置 make 参数
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
make
# 注:此步需要等待较长时间
make install
docker export -o xxxx-opencv.tar CONTAINERID
docker import xxxx-opencv.tar xxxx/xxx/xxx-opencv
这样我们就大功告成啦,只需要将倒入的image上传到自己的镜像仓库就完成了。
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK