Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
nizq committed Dec 26, 2015
1 parent 0a5c2bd commit e8ba8f9
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM alpine:3.3

ADD repositories /etc/apk/
RUN set -ex \
&& apk add --update bash ca-certificates gcc musl-dev \
go openssl git linux-headers g++ make \
libexecinfo-dev leveldb-dev libaio-dev \
libseccomp-dev argp-standalone snappy-dev

VOLUME ["/source"]
14 changes: 14 additions & 0 deletions Dockerfile.final
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM alpine:3.3

MAINTAINER nizq <[email protected]>

ADD repositories /etc/apk/
RUN echo "===> Adding dependency..." && \
apk add --update zlib openssl libstdc++ libexecinfo leveldb libaio \
libseccomp curl jq tcpdump snappy && \
rm -rf /var/cache/apk/*

ADD steno* /usr/bin/
ADD libtestimony.so /usr/lib/

VOLUME ["/etc/stenographer", "/data"]
11 changes: 11 additions & 0 deletions build-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

docker build -t nizq/steno-build .
docker run --rm -ti \
-v `pwd`:/source \
nizq/steno-build /source/build-steno.sh

cp Dockerfile.final final/Dockerfile
cp repositories final
cd final
docker build -t nizq/stenographer .
39 changes: 39 additions & 0 deletions build-steno.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/sh

HTTPS_PROXY=https://10.0.0.1:8123

SOURCE=/source
BUILD_DIR=$SOURCE/build
FINAL_DIR=$SOURCE/final

export GOPATH=${SOURCE}/go
STENO_DIR=${GOPATH}/src/github.com/nizq/stenographer
STENOTYPE_DIR=${STENO_DIR}/stenotype

echo "===> Build testimony..."
cd $BUILD_DIR
if [ ! -d "testimony" ]; then
git clone https://github.com/google/testimony.git
fi
cd testimony/c
make
cp -f -v libtestimony.a /usr/lib
cp -f -v libtestimony.so /usr/lib
cp -f -v libtestimony.so $FINAL_DIR/
cp -f -v testimony.h /usr/include

echo "===> Install golang/x/net/context..."
https_proxy=${HTTPS_PROXY} go get golang.org/x/net/context

echo "===> Install stenographer..."
go get github.com/nizq/stenographer

echo "===> Build stenotype manually..."
cd $STENOTYPE_DIR
make

echo "Collect files ..."
cp -f -v $GOPATH/bin/stenographer $FINAL_DIR/
cp -f -v $STENO_DIR/stenocurl $FINAL_DIR/
cp -f -v $STENO_DIR/stenoread $FINAL_DIR/
cp -f -v $STENOTYPE_DIR/stenotype $FINAL_DIR/
Empty file added build/.gitignore
Empty file.
Empty file added final/.gitignore
Empty file.
3 changes: 3 additions & 0 deletions repositories
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
http://dl-4.alpinelinux.org/alpine/v3.3/main
http://dl-4.alpinelinux.org/alpine/v3.3/community
http://dl-4.alpinelinux.org/alpine/edge/testing

0 comments on commit e8ba8f9

Please sign in to comment.