Signed-off-by: Jess Frazelle <jess@mesosphere.com>
This commit is contained in:
Jess Frazelle
2016-04-06 10:21:51 -07:00
parent 455b5ca9e0
commit 3dc19702e0
4 changed files with 42 additions and 20 deletions

View File

@@ -1,18 +1,19 @@
FROM java:8-alpine
MAINTAINER Jessica Frazelle <jess@docker.com>
RUN apk --update add \
apache-ant \
bash \
git \
perl \
python \
zip \
--update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ \
&& rm -rf /var/cache/apk/*
# install buck
RUN git clone --depth 1 https://github.com/facebook/buck.git /buck \
RUN buildDeps=' \
apache-ant \
bash \
git \
perl \
python \
zip \
' \
set -x \
&& apk --update add $buildDeps \
--update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ \
&& git clone --depth 1 https://github.com/facebook/buck.git /buck \
&& ( \
cd /buck \
&& ant \
@@ -23,12 +24,12 @@ RUN git clone --depth 1 https://github.com/facebook/buck.git /buck \
cd /gitiles \
&& touch .nobuckcheck \
&& git submodule update --init \
&& buck build all \
&& mv buck-out/gen/gitiles/gitiles.war /gitiles.war \
&& buck build gitiles-dev:dev \
) \
&& rm -rf /gitiles \
&& rm -rf /buck
&& apk del $buildDeps \
&& rm -rf /buck \
&& rm -rf /var/cache/apk/*
COPY ./start.sh /start.sh
COPY start.sh /start.sh
ENTRYPOINT [ "/start.sh" ]

View File

@@ -1,12 +1,28 @@
#!/bin/sh
set -e
ROOT="/gitiles"
ROOT=/gitiles
PROPERTIES=
if [ "x$1" != "x" ]; then
PROPERTIES="-Dcom.google.gitiles.configPath=$1"
PROPERTIES="-Dcom.google.gitiles.configPath=$1"
else
PROPERTIES="-Dcom.google.gitiles.configPath=/gitfiles.config"
cat > /gitfiles.config <<-EOF
[gitiles]
# Repositories placed here
basePath = /home/git
# Do not check they are exported
exportAll = true
# This URL will be displayed as clone URL. DO NOT FORGET TRAILING SLASH!
baseGitUrl = git@g.j3ss.co:
# Title of site (doh)
siteTitle = Gitiles - git.j3ss.co
# I dunno why, but it is have to be configured.
canonicalHostName = git.j3ss.co
EOF
fi
PROPERTIES="$PROPERTIES -Dcom.google.gitiles.sourcePath=$ROOT"
exec java $PROPERTIES -jar "$ROOT/buck-out/gen/gitiles/gitiles.war"
exec java $PROPERTIES -jar "$ROOT/buck-out/gen/gitiles-dev/dev.jar"