-
Notifications
You must be signed in to change notification settings - Fork 350
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the build system to use a Makefile.
This allows for a 'mixin' approach when building the image and means it doesn't derive from the `geodata/gdal` image any more but uses `ubuntu:trusty` instead.
- Loading branch information
Homme Zwaagstra
committed
Aug 6, 2015
1 parent
980fbfa
commit e9a9ba3
Showing
4 changed files
with
69 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,27 +7,13 @@ | |
# Builder software (https://github.com/geo-data/cesium-terrain-builder). | ||
# | ||
|
||
FROM geodata/gdal:latest | ||
# Ubuntu 14.04 Trusty Tahyr | ||
FROM ubuntu:trusty | ||
MAINTAINER Homme Zwaagstra <[email protected]> | ||
|
||
# Install as root | ||
USER root | ||
|
||
# Upgrade from gcc 4.6 to 4.7 (see | ||
# http://askubuntu.com/questions/113291/how-do-i-install-gcc-4-7) | ||
RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test | ||
RUN apt-get update -y | ||
RUN apt-get install -y gcc-4.7 g++-4.7 | ||
RUN apt-get remove -y gcc-4.6 | ||
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.7 | ||
|
||
# Ensure `cmake` is present | ||
RUN apt-get install -y cmake | ||
|
||
# Install Cesium Terrain Builder itself | ||
ADD ./ctb-checkout.txt /tmp/ctb-checkout.txt | ||
ADD ./install-ctb.sh /tmp/ | ||
RUN sh /tmp/install-ctb.sh | ||
|
||
# Clean up APT when done | ||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
# Install the application. | ||
ADD . /usr/local/src/cesium-terrain-builder/ | ||
RUN apt-get update -y && \ | ||
apt-get install -y make && \ | ||
make -C /usr/local/src/cesium-terrain-builder install clean && \ | ||
apt-get purge -y make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
## | ||
# Install Cesium Terrain Builder from within a docker container | ||
# | ||
# This Makefile is designed to be run from within a docker container in order to | ||
# install Cesium Terrain Builder. The following is an example invocation: | ||
# | ||
# make -C /usr/local/src/cesium-terrain-builder install clean | ||
# | ||
|
||
# Version related variables. | ||
CTB_VERSION := $(shell cat ./ctb-checkout.txt) | ||
GDAL_VERSION := $(shell cat ./gdal-checkout.txt) | ||
|
||
# CTB dependency targets. | ||
CTB := /usr/local/bin/ctb-tile | ||
GDAL_CONFIG := /usr/local/bin/gdal_config | ||
CTB_SRC := /tmp/cesium-terrain-builder-$(CTB_VERSION) | ||
|
||
# Build tools. | ||
WGET := /usr/bin/wget | ||
|
||
install: $(CTB) | ||
|
||
$(CTB): $(CTB_SRC) /tmp/ctb-build $(GDAL_CONFIG) | ||
cd /tmp/ctb-build \ | ||
&& cmake $(CTB_SRC) \ | ||
&& make -j$$(nproc) \ | ||
&& make install \ | ||
&& ldconfig \ | ||
&& touch -c $(CTB) | ||
|
||
/tmp/ctb-build: | ||
mkdir -p /tmp/ctb-build | ||
|
||
$(CTB_SRC): $(WGET) | ||
$(WGET) --no-verbose "https://github.com/geo-data/cesium-terrain-builder/archive/$(CTB_VERSION).tar.gz" -O $(CTB_SRC).tar.gz \ | ||
&& tar -C /tmp -xzf $(CTB_SRC).tar.gz \ | ||
&& touch -c $(CTB_SRC) | ||
|
||
$(GDAL_CONFIG): /usr/local/src/gdal-docker | ||
make -C /usr/local/src/gdal-docker install \ | ||
&& touch -c $(GDAL_CONFIG) | ||
/usr/local/src/gdal-docker: $(WGET) | ||
$(WGET) --no-verbose "https://github.com/geo-data/gdal-docker/archive/$(CTB_VERSION).tar.gz" -O /tmp/gdal-docker-$(GDAL_VERSION).tar.gz \ | ||
&& tar -C /tmp -xzf /tmp/gdal-docker-$(GDAL_VERSION).tar.gz \ | ||
&& mv /tmp/gdal-docker-$(GDAL_VERSION) /usr/local/src/gdal-docker \ | ||
&& touch -c /usr/local/src/gdal-docker | ||
|
||
$(WGET): /tmp/apt-updated | ||
apt-get install -y wget && touch -c $(WGET) | ||
|
||
/tmp/apt-updated: | ||
apt-get update -y && touch /tmp/apt-updated | ||
|
||
# Remove build time dependencies. Delegate to gdal-docker clean as this removes | ||
# everything, including wget. | ||
clean: | ||
make -C /usr/local/src/gdal-docker clean | ||
|
||
.PHONY: install clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
master |
This file was deleted.
Oops, something went wrong.