对应从事遥感与地理信息的同仁来说,gdal应该是所有工具中使用频度最高的库了,那么在docker中使用gdal时,面临的第一步就是构建gdal基础镜像,社区中引用最多的就是geodata提供的gdal基础镜像包,封装的gdal最新版本是2.3.0dev。

geodata/gdal的docker在github上的地址如下:

https://github.com/geo-data/gdal-docker

根据该库的提交记录,其生成gdal镜像的方法经历了多次更新:

1 最初按照gdal官网步骤自行编译;

2 基于makefile采用make系统编译;

3 基于gdal的travel ci 脚本进行编译。

dockerfile内容如下:

##
# geodata/gdal
#
# This creates an Ubuntu derived base image that installs the latest GDAL
# subversion checkout compiled with a broad range of drivers.  The build process
# is based on that defined in
# <https://github.com/OSGeo/gdal/blob/trunk/.travis.yml>
## Ubuntu 14.04 Trusty Tahyr
FROM ubuntu:trustyMAINTAINER Homme Zwaagstra <hrz@geodata.soton.ac.uk># Install the application.
ADD . /usr/local/src/gdal-docker/
RUN /usr/local/src/gdal-docker/build.sh# Externally accessible data is by default put in /data
WORKDIR /data
VOLUME ["/data"]# Output version and capabilities by default.
CMD gdalinfo --version && gdalinfo --formats && ogrinfo --formats

基于ubuntu:trusty基础镜像,复制镜像构建相关内容到镜像的/usr/local/src/gdal-docker目录,利用build.sh脚本执行构建操作。

build.sh内容如下:

#!/bin/sh##
# Install GDAL from within a docker container
#
# This script is designed to be run from within a docker container in order to
# install GDAL. It delegates to `before_install.sh` and `install.sh` which are
# patched from the Travis CI configuration in the GDAL repository.
#set -eDIR=$(dirname "$(readlink -f "$0")")
GDAL_VERSION=$(cat ${DIR}/gdal-checkout.txt)export DEBIAN_FRONTEND=noninteractive# Set the locale. Required for subversion to work on the repository.
update-locale LANG="C.UTF-8"
dpkg-reconfigure locales
. /etc/default/locale
export LANG# Instell prerequisites.
apt-get update -y
apt-get install -y \software-properties-common \wget \unzip \subversion \ccache \clang-3.5 \patch \python-dev \ant# Everything happens under here.
cd /tmp# Get GDAL.
svn checkout --quiet "http://svn.osgeo.org/gdal/${GDAL_VERSION}/" /tmp/gdal/# Install GDAL.
cd /tmp/gdal# Apply our build patches.
patch ./gdal/ci/travis/trusty_clang/before_install.sh ${DIR}/before_install.sh.patch
patch ./gdal/ci/travis/trusty_clang/install.sh ${DIR}/install.sh.patch# Do the build.
. ./gdal/ci/travis/trusty_clang/before_install.sh
. ./gdal/ci/travis/trusty_clang/install.sh# Clean up.
apt-get autoremove -y
apt-get clean
rm -rf /var/lib/apt/lists/partial/* /tmp/* /var/tmp/*

设置GDAL_VERSION(从gdal-checkout.txt读取,为trunk,表示从svn主干分支下载源代码),下载gdal源代码到/tmp/gdal目录,下载编译器clang和python环境,对gdal的trusty_clang的travis安装脚本打补丁(通过修改后调用diff工具生成patch),安装gdal,清理临时文件。

转载于:https://www.cnblogs.com/dadream/p/8058810.html

docker社区的geodata/gdal镜像dockerfile分析相关推荐

  1. docker history 27f1068ca9da --no-trunc查看镜像dockerfile内容

    docker history 27f1068ca9da --no-trunc 参考链接:https://blog.csdn.net/whatday/article/details/103870042

  2. 实战:Docker容器虚拟化技术(使用DockerFile构建镜像并搭建 swarm+compose集群)5

    实战:Docker容器虚拟化技术 (使用DockerFile构建镜像并搭建 swarm+compose集群)5 要求: 使用DockerFile构建镜像并搭建 swarm+compose集群 在Swa ...

  3. Docker之使用maven插件【Dockerfile方式】构建并推送镜像到私有仓库

    准备工作 操作系统版本 [root@node02 ~]# cat /etc/redhat-release CentOS Linux release 7.5.1804 (Core) docker版本 [ ...

  4. Docker(2):使用Dockerfile创建支持SSH服务的镜像

    1.创建工作目录 # mkdir sshd_ubuntu # ls 在其中,创建Dockerfile和run.sh文件 # cd sshd_ubuntu/ # touch Dockerfile run ...

  5. docker中使用golang:alpine镜像制作开启goweb的dockerfile

    docker中使用golang:alpine镜像制作开启goweb的dockerfile go的web代码 package mainimport("net/http""f ...

  6. Docker学习,从hello-word到Dockerfile创建镜像

    一.Docker的最小镜像hello-world 1.docker  pull 下载hello-world镜像 docker  pull   hello-world 2.docker  images ...

  7. Docker的安装和使用及dockerfile简单使用

    Docker的安装和使用及dockerfile简单使用 一.简介 Docker是一个基于go语言的开源的应用容器引擎,可以将开发者的应用及依赖包打包到一个可移植容器当中,然后发布到任何流行的Linux ...

  8. 1. Docker 基础(概念、镜像命令、容器命令、...)

    官网: https://hub.docker.com/ 文档 官方文档:https://docs.docker.com/ 官方文档:cli指令:https://docs.docker.com/engi ...

  9. 深入浅出Docker原理及实战(三)——制作Dockerfile

    声明:这是我在大学毕业后进入第一家互联网公司学习的内容 深入浅出Docker原理及实战系列第三篇,我主要分享如何制作一个Dockerfile,以及基本命令格式. Dockerfile简介 Docker ...

最新文章

  1. java实现qq_java实现的类似qq聊天系统
  2. javaScript一些函数--Math()
  3. 底层基础软件崛起,达梦数据库的选择与收获
  4. python刷b站教程_【Python】【学习资源】B站上的Python学习资源
  5. 二维码识别开源库-Quire码
  6. 此设备不允许更改其写入高速缓存设置_优化SiT15xx驱动器设置32 kHz晶体输入低功耗MCU程序设计细节(一)...
  7. 基于RFID定位技术的智能仓储管理系统--RFID智能仓储--新导智能
  8. ElasticSearch 学习笔记(一)
  9. linux srs安装教程,SRS环境搭建
  10. 基于node.js和Vue的运动装备网上商城
  11. Muli3D 3 qQuaternionRotationMatrix 函数 (矩阵转四元数)
  12. linux系统命令梳理
  13. 存量时代的竞争法则,从local champion做起
  14. Flink Forward Asia 2019 总结和展望 - 附PPT下载
  15. 30. 主频和时钟配置实验
  16. Excel按颜色求和,计数,均值
  17. MATLAB的cftool工具箱简介
  18. 老公月入五万的程序员夫人,都过上贵妇的生活了么?
  19. 从100万个数中找出最大的前100个数
  20. 多隆:从工程师到阿里巴巴合伙人

热门文章

  1. 基于php的织梦cms新闻发布,DedeCms
  2. ActionMapping
  3. 南非世界杯火热角逐 金山网盾开启搜索保护
  4. java action提交表单数据,form表单action提交详解
  5. Java使用GDAL
  6. Arcgis javascript那些事儿(十四)——连接oracle
  7. dreamweaver cs6配置phonegap环境
  8. DXUT框架剖析(6)
  9. 高级着色语言HLSL入门(5)
  10. 数字通信原理_计算机网络原理梳理丨物理层