-
Notifications
You must be signed in to change notification settings - Fork 35
/
Dockerfile
83 lines (72 loc) · 2.59 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
74
75
76
77
78
79
80
81
82
83
# This is a fork of the tools/Dockerfile.CI with changes necessary for Google Cloud Build.
FROM ubuntu:xenial
# Install programs for runtime use (e.g. by Bazel, Node-GYP)
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
apt-transport-https \
bash \
ca-certificates \
curl \
g++ \
git \
lbzip2 \
make \
nodejs \
openjdk-8-jdk \
python \
unzip \
xz-utils
# Install Chrome for Selenium
# Reference: https://tecadmin.net/setup-selenium-chromedriver-on-ubuntu/
RUN curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add
RUN echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list
RUN apt-get -y update && apt-get -y install google-chrome-stable
# Set up workspace
ENV WORKSPACE /usr/src/app
RUN mkdir -p $WORKSPACE
WORKDIR $WORKSPACE
# Install ktlint
RUN (cd /usr/bin/ && \
curl -L -s -O https://github.com/pinterest/ktlint/releases/download/0.35.0/ktlint && \
cd - && \
chmod +x /usr/bin/ktlint)
# Install Nodejs & npm
# Also, allows running script with privileged permission
# i.e. scripts {...} at package.json. See unsafe-perm below.
RUN (curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
apt-get install -y nodejs && \
npm set unsafe-perm true)
# Install Android SDK
ENV ANDROID_HOME "/sdk"
COPY tools/android-sdk-packages.txt tools/android-sdk-packages.txt
COPY tools/install-android-sdk tools/install-android-sdk
COPY tools/logging.sh tools/logging.sh
# Android sdkmanager does not have a quiet option and outputs highly
# verbose progress to stdout, so we forcibly silence it at risk of
# missing insight into failure modes.
RUN tools/install-android-sdk ${ANDROID_HOME} > /dev/null
# Install npm packages
COPY concrete-storage/package.json concrete-storage/package.json
RUN (cd concrete-storage && npm install)
COPY package.json package.json
COPY tools tools
COPY config config
COPY devtools devtools
RUN npm install
# Fetch external Bazel artifacts.
# Copy over the WORKSPACE file, everything it imports, and bazelisk.
COPY tools/bazelisk* tools/
COPY build_defs/emscripten build_defs/emscripten
COPY build_defs/kotlin_native build_defs/kotlin_native
COPY .bazelignore \
.bazelversion \
.editorconfig \
WORKSPACE \
BUILD.bazel \
maven_install.json \
./
RUN ./tools/bazelisk fetch @maven//...
RUN ./tools/bazelisk fetch @kotlin_native_compiler//...
RUN ./tools/bazelisk fetch @emsdk//...
# Copy the contents of the working dir. After this the image should be ready for
# use.
COPY . .