forked from yammer/mcrouter-build-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- This creates a new directory ./14.04, or ./12.04 - I'm not sure if this is the best way. See yammer#1
- Loading branch information
root
committed
Oct 19, 2015
1 parent
293200c
commit 67c3f7a
Showing
4 changed files
with
47 additions
and
10 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 |
---|---|---|
@@ -1 +1,2 @@ | ||
*.deb | ||
Dockerfile-* |
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 |
---|---|---|
@@ -1,9 +1,11 @@ | ||
FROM ubuntu:12.04 | ||
FROM ubuntu:__RELEASE__ | ||
MAINTAINER Brian Morton "[email protected]" | ||
|
||
ENV MCROUTER_VERSION 0.9 | ||
ENV MCROUTER_SHA e1d90728efc109f1c7258d36b641264a56bd04a8 | ||
ENV FOLLY_SHA f63b080574f6a139c952fe2a0c06f16fdf170042 | ||
ENV RELEASE 14.04 | ||
|
||
|
||
# Install tools needed by install scripts below | ||
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections | ||
|
@@ -16,8 +18,33 @@ RUN curl -L https://github.com/facebook/mcrouter/archive/${MCROUTER_SHA}.tar.gz | |
|
||
# Build folly, a dependency of mcrouter | ||
WORKDIR /tmp/folly-${FOLLY_SHA}/folly | ||
RUN apt-get -y update && ./build/deps_ubuntu_12.04.sh | ||
RUN apt-get -y install libboost-program-options1.54-dev | ||
RUN apt-get -y update && if [ ${RELEASE} = "12.04" ]; then \ | ||
./build/deps_ubuntu_12.04.sh && apt-get -y install libboost-program-options1.54-dev; else \ | ||
apt-get install -y \ | ||
software-properties-common \ | ||
python-software-properties \ | ||
autoconf \ | ||
binutils-dev \ | ||
g++ \ | ||
gcc \ | ||
git \ | ||
libboost-context1.54-dev \ | ||
libboost-filesystem1.54-dev \ | ||
libboost-program-options1.54-dev \ | ||
libboost-regex1.54-dev \ | ||
libboost-system1.54-dev \ | ||
libboost-thread1.54-dev \ | ||
libboost1.54-dev \ | ||
libdouble-conversion-dev \ | ||
libevent-dev \ | ||
libgflags-dev \ | ||
libgoogle-glog-dev \ | ||
libssl-dev \ | ||
libtool \ | ||
make \ | ||
python-dev \ | ||
ragel; \ | ||
fi | ||
RUN autoreconf -ivf && ./configure | ||
RUN make -j4 | ||
RUN make install | ||
|
@@ -26,7 +53,7 @@ RUN make install | |
WORKDIR /tmp/mcrouter-${MCROUTER_SHA}/mcrouter | ||
ENV LDFLAGS -Wl,-rpath=/usr/local/lib/mcrouter/ | ||
ENV LD_LIBRARY_PATH /usr/local/lib/mcrouter/ | ||
RUN mkdir /tmp/mcrouter-build && ./scripts/install_ubuntu_12.04.sh /tmp/mcrouter-build -j4 | ||
RUN mkdir /tmp/mcrouter-build && ./scripts/install_ubuntu_${RELEASE}.sh /tmp/mcrouter-build -j4 | ||
|
||
# Install Ruby so we can install fpm for building the Debian package | ||
RUN add-apt-repository ppa:brightbox/ruby-ng | ||
|
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 |
---|---|---|
@@ -1,15 +1,21 @@ | ||
VERSION = `grep "ENV MCROUTER_VERSION" Dockerfile | cut -f3 -d' '` | ||
SHA = `grep "ENV MCROUTER_SHA" Dockerfile | cut -f3 -d' '` | ||
RELEASE = `grep "ENV RELEASE" Dockerfile | cut -f3 -d' '` | ||
|
||
.PHONY: all build cp | ||
|
||
all: build cp | ||
all: build cp | ||
|
||
build: | ||
docker build -t mcrouter . | ||
sed "1 s/__RELEASE__/${RELEASE}/" Dockerfile > Dockerfile-${RELEASE} | ||
docker build --no-cache -t mcrouter -f Dockerfile-${RELEASE} . | ||
|
||
cp: | ||
docker create --name=mcrouter-build mcrouter && docker cp mcrouter-build:/tmp/mcrouter-build/install/yammer-mcrouter_${VERSION}-${SHA}_amd64.deb . && docker rm -f mcrouter-build | ||
mkdir ./${RELEASE} | ||
docker create --name=mcrouter-build mcrouter && docker cp mcrouter-build:/tmp/mcrouter-build/install/yammer-mcrouter_${VERSION}-${SHA}_amd64.deb ./${RELEASE}/yammer-mcrouter_${VERSION}-${SHA}_amd64.deb && docker rm -f mcrouter-build | ||
|
||
test: | ||
docker run -ti --rm -v `pwd`:/opt/mcrouter-build ubuntu:12.04 sh -c "dpkg -i /opt/mcrouter-build/yammer-mcrouter_${VERSION}-${SHA}_amd64.deb; mcrouter --version; /bin/bash" | ||
docker run -ti --rm -v `pwd`:/opt/mcrouter-build ubuntu:${RELEASE} sh -c "dpkg -i /opt/mcrouter-build/yammer-mcrouter_${VERSION}-${SHA}_amd64.deb; mcrouter --version; /bin/bash" | ||
|
||
clean: | ||
rm -f Dockerfile-* |
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