Skip to content

Instantly share code, notes, and snippets.

@cybernetlab
Last active October 20, 2018 16:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cybernetlab/82cf6f296b22ad78999e to your computer and use it in GitHub Desktop.
Save cybernetlab/82cf6f296b22ad78999e to your computer and use it in GitHub Desktop.
doker.io Dockerfile for cocaine builds
# This file used by docker.io for creating custom debian packages of cocaine
# core and plugins.
#
# Feel free to change FROM to you target system
#
# To build image and packages create empty folder, `cd` to it,
# put this file there as `Dockerfile` and run:
#
# `sudo docker.io build -t cocaine-builder .`
#
# To get compiled debian packages run (tgz arhive with packages
# will be available in /tmp):
#
# `sudo docker.io run -v /tmp:/out cp /packages/cocaine-0.11.2.tgz /out`
#
FROM ubuntu:14.04
# install requirements
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y git
RUN sudo apt-get -y install equivs devscripts libssl-dev git libboost-thread-dev \
libnl-dev libcurl4-openssl-dev build-essential \
cmake libboost-program-options-dev libarchive13 \
libboost-program-options1.54-dev libev-dev liblzo2-2 \
libnettle4 libsigsegv2 liburiparser-dev libxml-parser-perl \
libxml2-dev python-scour autoconf automake autotools-dev \
cdbs dh-translations intltool libboost-system-dev m4 \
binutils-dev libarchive-dev libboost-dev libboost-filesystem-dev \
libboost-filesystem1.54-dev libboost-filesystem1.54.0 libcgroup-dev \
libcgroup1 libltdl-dev libltdl7 libmsgpack-dev libmsgpack3 libmsgpackc2 \
uuid-dev
# prepare sources
RUN mkdir /build
RUN git clone https://github.com/reverbrain/swarm.git /build/swarm
RUN git clone https://github.com/cocaine/cocaine-core.git -b v0.11 /build/cocaine-core
RUN git clone https://github.com/cocaine/cocaine-plugins.git -b v0.11 /build/cocaine-plugins
RUN git clone https://github.com/cocaine/cocaine-tools.git -b v0.11 /build/cocaine-tools
RUN git clone https://github.com/cocaine/cocaine-framework-native.git -b v0.11 /build/cocaine-framework-native
RUN git clone https://github.com/cocaine/cocaine-native-proxy.git /build/cocaine-native-proxy
RUN cd /build/swarm && git checkout tags/v0.6.3.6
RUN cd /build/cocaine-core && git submodule update --init
# build and install libswarm and libthevoid2
RUN cd /build/swarm && debuild -sa -uc -us
RUN dpkg -i /build/libswarm2*_amd64.deb /build/libswarm-dev_*_amd64.deb
RUN dpkg -i /build/libthevoid2_*_amd64.deb /build/libthevoid-dev_*_amd64.deb
# build core and install core libraries
RUN cd /build/cocaine-core && debuild -sa -uc -us
RUN dpkg -i /build/libcocaine-core2_*_amd64.deb /build/libcocaine-dev_*_amd64.deb
# link old-style boost-mt to fix cocaine-plugins build
RUN ln -s /usr/lib/x86_64-linux-gnu/libboost_system.so /usr/lib/x86_64-linux-gnu/libboost_system-mt.so
RUN ln -s /usr/lib/x86_64-linux-gnu/libboost_filesystem.so /usr/lib/x86_64-linux-gnu/libboost_filesystem-mt.so
RUN ln -s /usr/lib/x86_64-linux-gnu/libboost_program_options.so /usr/lib/x86_64-linux-gnu/libboost_program_options-mt.so
# build plugins
RUN cd /build/cocaine-plugins && git checkout de1c5715fddea8186540ca30254cc0108e5274e6
# other versions tested:
# git checkout fd2b771ad3b709c2110ec965a25a1a671aa991f0 - not working
# git checkout ca930dfb53ef00b703ff41a7e45b3934c570d2a5 - not working
RUN cd /build/cocaine-plugins && git submodule update --init
RUN cd /build/cocaine-plugins && debuild -sa -uc -us
RUN apt-get install -y bash-completion python-pkg-resources python-setuptools
# build tools
RUN cd /build/cocaine-tools && debuild -sa -uc -us
# build native framework
RUN cd /build/cocaine-framework-native && debuild -sa -uc -us
RUN dpkg -i /build/cocaine-framework-native_*_amd64.deb /build/cocaine-framework-native-dev_*_amd64.deb
# build native proxy
RUN cd /build/cocaine-native-proxy && debuild -sa -uc -us
RUN mkdir /packages && cp /build/*.deb /packages && cd packages && tar -zcf cocaine-0.11.2.tgz *
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment