Created
November 6, 2014 02:04
-
-
Save mdaniel/7fd440f8a7fa0c1a3ef4 to your computer and use it in GitHub Desktop.
Build mesos using a Docker image (for Mac OS X or systems where you don't want the dependencies splattered all over your real machine)
This file contains hidden or 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
#! /bin/sh | |
set -e | |
if [ "x$1" = "x-proxy" ]; then | |
shift | |
PX="http://192.168.59.3:8888/" | |
if [ ! -d /etc/apt/apt.conf.d ]; then | |
mkdir -p /etc/apt/apt.conf.d | |
fi | |
APT_CACHE_FILE=/etc/apt/apt.conf.d/00proxy | |
cat >${APT_CACHE_FILE}<<PROXY | |
Acquire::http::Proxy "${PX}"; | |
http::Proxy "${PX}"; | |
https::Proxy "${PX}"; | |
PROXY | |
fi | |
DEBIAN_FRONTEND=noninteractive | |
export DEBIAN_FRONTEND | |
apt-get update | |
PKGS="$PKGS build-essential" | |
PKGS="$PKGS curl" | |
PKGS="$PKGS libxml2" | |
PKGS="$PKGS libxslt1.1" | |
PKGS="$PKGS libapr1-dev" | |
PKGS="$PKGS libcurl4-nss-dev" | |
PKGS="$PKGS libevent-dev" | |
PKGS="$PKGS libffi-dev" | |
PKGS="$PKGS libsasl2-dev" | |
PKGS="$PKGS libssl-dev" | |
PKGS="$PKGS libsvn-dev" | |
PKGS="$PKGS libxml2-dev" | |
PKGS="$PKGS libxslt1-dev" | |
PKGS="$PKGS libyaml-dev" | |
PKGS="$PKGS maven" | |
PKGS="$PKGS openjdk-6-jdk" | |
PKGS="$PKGS python2.7" | |
PKGS="$PKGS python-boto" | |
PKGS="$PKGS python-dev" | |
apt-get -y install -f $PKGS | |
## clean this up so we don't pollute the image | |
if [ -f "${APT_CACHE_FILE}" ]; then | |
rm ${APT_CACHE_FILE} | |
fi | |
rm -rf /var/cache/apt /var/lib/apt |
This file contains hidden or 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
# copy this file and do-apt-stuff.sh into an empty directory | |
# along with the mesos source tar file, then "docker build ." | |
FROM ubuntu:14.04 | |
MAINTAINER Matthew L Daniel <[email protected]> | |
ADD do-apt-stuff.sh /tmp/apt.sh | |
RUN sh -x /tmp/apt.sh && rm /tmp/apt.sh | |
ADD mesos-0.20.1.tar.gz /tmp | |
RUN cd /tmp/mesos-0.20.1 && ./configure --prefix=/opt/mesos-0.20.1 && make && make install && tar cvzf /tmp/mesos-0.20.1-bin.tar.gz -C /opt mesos-0.20.1 | |
# now "docker cp ${container}:/tmp/mesos*bin.tar.gz mesos-0.20.1-bin.tar.gz" | |
# and clean up the container and its images |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment