Last active
December 21, 2015 21:58
-
-
Save philipsoutham/6371770 to your computer and use it in GitHub Desktop.
Afraid to build golucy and her requirements on your pristine box? Well if you're running docker you can use this Dockerfile to run the golucy_getting_started.go sample.
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
# golang & golucy | |
FROM ubuntu:latest | |
MAINTAINER Philip Southam "[email protected]" | |
# BUILD DEPS | |
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list | |
RUN apt-get update | |
RUN apt-get install build-essential autoconf libtool git curl wget bzr openssh-client mercurial -y | |
# BUILD APACHE LUCY | |
RUN test -d /src || mkdir /src | |
ENV LUCY_BUILD /src/lucy | |
RUN cd /src; git clone -b e19687f9a6b0158308ac7bcafc663296635b107a --depth=10 https://git-wip-us.apache.org/repos/asf/lucy.git | |
RUN cd $LUCY_BUILD/c; ./configure --prefix=/usr && make && make test && make install && ./install.sh --prefix /usr | |
RUN cd $LUCY_BUILD/clownfish/runtime/c; ./configure --prefix=/usr && make && make test && make install && ./install.sh --prefix /usr | |
RUN ldconfig | |
# SET UP GO | |
RUN test -d /opt || mkdir /opt | |
WORKDIR /opt | |
RUN wget https://go.googlecode.com/files/go1.1.2.linux-amd64.tar.gz | |
RUN tar xf go1.1.2.linux-amd64.tar.gz | |
RUN rm -f go1.1.2.linux-amd64.tar.gz | |
ENV GOROOT /opt/go | |
ENV PATH $GOROOT/bin:$PATH | |
# SET UP SAMPLE PROJECT | |
RUN test -d /srv/go/src || mkdir -p /srv/go/src | |
RUN test -d /srv/go/src/searcher || mkdir -p /srv/go/src/searcher | |
RUN test -d /srv/go/bin || mkdir -p /srv/go/bin | |
RUN test -d /srv/go/pkg || mkdir -p /srv/go/pkg | |
RUN test -d /tmp/lucy_index || mkdir -p /tmp/lucy_index | |
ENV GOPATH /srv/go | |
ENV CGO_CFLAGS -I/usr/include | |
ENV CGO_LDFLAGS -L/usr/lib -llucy -lcfish | |
ENV PATH /srv/go/bin:$PATH | |
WORKDIR /srv/go/src/searcher | |
RUN wget https://gist.github.com/philipsoutham/6395791/raw/e3a15eab5313219f21ddc2b20d1af7d3bc8dbaf6/golucy_example1.go | |
RUN go get | |
RUN go install | |
CMD ["searcher"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment