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--->运维: 集群 ...
随机推荐
- openCV2马拉松第19圈——Harris角点检測(自己实现)
计算机视觉讨论群162501053 转载请注明:http://blog.csdn.net/abcd1992719g/article/details/26824529 收入囊中 使用OpenCV的con ...
- Codeforces Round #540 (Div. 3) F1. Tree Cutting (Easy Version) 【DFS】
任意门:http://codeforces.com/contest/1118/problem/F1 F1. Tree Cutting (Easy Version) time limit per tes ...
- Kali-linux设置ProxyChains
ProxyChains是Linux和其他Unices下的代理工具.它可以使任何程序通过代理上网,允许TCP和DNS通过代理隧道,支持HTTP.SOCKS4和SOCKS5类型的代理服务器,并且可配置多个 ...
- python对文件进行读写操作
转:http://sucre.iteye.com/blog/704077 ython进行文件读写的函数是open或file file_handler = open(filename,,mode) Ta ...
- 用js写三个数,让三个数从小到大排列
console.log('请输入三个数:'); let num1 = readline.question() - 0; let num2 = readline.question() - 0; let ...
- Swift:一个基于.NET Core的分布式批处理框架
Swift是什么 从文章的标题可知:此Swift非Apple那个Swift,只是考虑这个词的含义比较适合. Swift是一个基于.NET Core的分布式批处理框架,支持将作业分割后分发到多台服务器并 ...
- 【oracle笔记2】约束
约束 *约束是添加在列上的,用来约束列的. 1. 主键约束(唯一标识) ***非空*** ***唯一*** ***被引用***(外键时引用主键) *当表的某一列被指定为主键后,该列就不能为空,不能有重 ...
- 笔记: 对称加密算法的PKCS5 和 PKCS7 填充
PKCS #7 填充字符串由一个字节序列组成,每个字节填充该填充字节序列的长度. 假设,块的长度是 8, 数据长度是 5 数据:AA AA AA AA AA PKCS#7 填充 AA AA AA AA ...
- vue服务端渲染缓存应用
vue缓存分为页面缓存.组建缓存.接口缓存,这里我主要说到了页面缓存和组建缓存 页面缓存: 在server.js中设置 const LRU = require('lru-cache') const m ...
- 跨域详解之-----Jsonp跨域
一.通过jsonp跨域 在js中,我们直接用XMLHttpRequest请求不同域上的数据时,是不可以的.但是,在页面上引入不同域上的js脚本文件却是可以的,jsonp正是利用这个特性来实现的. 比如 ...