-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
73 lines (63 loc) · 2.04 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
FROM alpine:latest
MAINTAINER davido
ENV BAZEL_VERSION 0.13.0
ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk
RUN apk add --no-cache --virtual=.build-deps \
coreutils \
ca-certificates \
wget \
git \
go \
perl \
python \
python-dev \
nodejs \
nodejs-npm \
openssh \
bash \
curl \
g++ \
musl-dev \
openjdk8 \
sudo \
sed \
zip \
libarchive \
unzip \
\
&& ln -s /usr/lib/jvm/java-1.8-openjdk/bin/javac /usr/bin \
&& ln -s /usr/lib/jvm/java-1.8-openjdk/bin/jar /usr/bin \
\
&& wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://raw.githubusercontent.com/sgerrand/alpine-pkg-glibc/master/sgerrand.rsa.pub \
&& wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.26-r0/glibc-2.26-r0.apk \
&& apk add glibc-2.26-r0.apk \
\
&& wget -q -O /etc/apk/keys/[email protected] https://raw.githubusercontent.com/davido/bazel-alpine-package/master/[email protected] \
&& wget https://github.com/davido/bazel-alpine-package/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-r0.apk \
&& apk add bazel-${BAZEL_VERSION}-r0.apk \
\
&& npm config set user 0 \
&& npm config set unsafe-perm true \
&& npm install -g \
eslint \
eslint-config-google \
eslint-plugin-html \
typescript \
fried-twinkie \
polylint \
web-component-tester \
\
&& adduser -D builder -s /bin/bash \
&& echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
COPY .* /home/builder/
RUN chown builder:builder /home/builder/.*
RUN mkdir -p /home/builder/.gerritcodereview/bazel-cache/cas \
&& mkdir -p /home/builder/.gerritcodereview/bazel-cache/repository \
&& mkdir -p /home/builder/.gerritcodereview/buck-cache/downloaded-artifacts
USER builder
RUN mkdir -p /home/builder/gerrit
WORKDIR /home/builder/gerrit
# Extract instaled bazel version (warm up bazel installation)
# TODO(davido): check why this is causing problem with rules_closur
RUN bazel version
ENTRYPOINT ["bash"]