docker社区的geodata/gdal镜像dockerfile分析
对应从事遥感与地理信息的同仁来说,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:trusty MAINTAINER 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 -e DIR=$(dirname "$(readlink -f "$")")
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,清理临时文件。
docker社区的geodata/gdal镜像dockerfile分析的更多相关文章
- 官方Tomcat镜像Dockerfile分析及镜像使用
官方Tomcat镜像 地址:https://hub.docker.com/_/tomcat/ 镜像的Full Description中,我们可以得到许多信息,这里简单介绍下: Supported ta ...
- Docker探索系列2之镜像打包与DockerFile
preface docker基本入门以后,可以试试打包docker镜像与dockerfile了 docker镜像 docker hub仓库有2类仓库,用户仓库和顶层仓库,用户仓库由docker用户创建 ...
- Docker(2):使用Dockerfile创建支持SSH服务的镜像
1.创建工作目录 # mkdir sshd_ubuntu # ls 在其中,创建Dockerfile和run.sh文件 # cd sshd_ubuntu/ # touch Dockerfile run ...
- centos7下安装docker(3.3创建镜像--修改dockerfile)
1.我们在制作dockerfile的时候可能有些命令无法执行,导致镜像无法创建成功,这时我们可以修改dockerfile,从而达到我们的目的 查看Dockerfile内容 创建新的镜像,失败 Dock ...
- 在docker hub,用github的dockerfile自动生成docker镜像
简介: 我已经深深的爱上了docker技术. 在日常使用中,经常看到docker hub 中有很多autobuild的镜像.基本使用是在github中上传dockerfile,过一会儿,docker ...
- CMD centos7 安装 最新版本的docker -- dockerfire 原语 ENTRYPOINT - 导入镜像 tar mariadb Dockerfile 构建镜像
yum update # vim /etc/yum.repos.d/docker.repo //添加以下内容 [dockerrepo] name=Docker Repository baseurl=h ...
- Docker 学习笔记 (一)Dockerfile 创建本地镜像
一.测试环境 OS version: CentOS Linux release 7.5.1804 (Core) docker cluster : master 1 + data node 4 dock ...
- Docker如何制作镜像-Dockerfile的使用
1:什么是Dockerfile Dockerfile是一个文本文档,可以通过docker build 命令构建成一个镜像. 我们可以在Dockerfile中定义一系列的命令,构建出我们想要的镜像. 想 ...
- Docker详细介绍安装与镜像制作和拉取
一.Docker是什么? 产生背景: 开发和运维之间因为环境不同和导致的矛盾(不同的操作系统.软件环境.应用配置等)DevOps 代码.系统.环境.配置等封装成镜像Image--->运维: 集群 ...
随机推荐
- PHP使用in_array函数检查数组中是否存在某个值
PHP使用 in_array() 函数检查数组中是否存在某个值,如果存在则返回 TRUE ,否则返回 FALSE. bool in_array( mixed needle, array array [ ...
- SpringMVC关于请求参数乱码问题
String names =request.getParameter("name") request主要接收的参数是form提交 form提交有的时候会伴随着乱码,该乱码的格式为I ...
- mongo复制集、分片集(亲测)
1.1 架构思路: 192.168.50.131 192.168.50.131 192.168.50.132 mongos mongos mongos ...
- sql获取时间、年龄
mysql数据库获取年龄:TIMESTAMPDIFF(YEAR, [出生日期字段], CURDATE()) select * from (select name 姓名,TIMESTAMPDIFF( ...
- js的匿名函数与自定义函数
//匿名方法,会执行,自己调用自己 (function () { console.log(window.innerHeight); })(); (function () { console.log(w ...
- platform平台总线
一.何为平台总线 (1)相对于usb.pci.i2c等物理总线来说,platform总线是虚拟的.抽象出来的.(2)CPU与外部通信的2种方式:地址总线式连接和专用协议类接口式连接.平台总线,是扩展到 ...
- Jewels and Stones
题目如下 You're given strings J representing the types of stones that are jewels, and S representing the ...
- Python 基础 变量和数据类型
python 数据类型 一,整数,可以出来任意大小的整数. 如 1, 100, -8080,0 等等. 二,浮点数,浮点数也可以被成为小数. 三,字符串,字符串是以'' 或"". ...
- Element表单验证规则
一.简单的逻辑验证使用方法: 方法步骤: 1.在html中给el-form增加 :rules="rules" 2.html中在el-form-item 中增加属性 prop=&qu ...
- 三层架构,Struts2,SpringMVC实现原理图
三层架构,Struts2,SpringMVC实现原理图 三层架构实现原理 Struts2实现原理 SpringMVC实现原理