-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
137 lines (113 loc) · 4.55 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
ARG SWIFLINT_DOCKER_IMAGE
ARG SWIFT_DOCKER_IMAGE
FROM $SWIFT_DOCKER_IMAGE as carton-builder
ARG SWIFT_TAG
ARG CARTON_TAG
RUN apt-get update && apt-get install -y libsqlite3-dev
RUN git clone https://github.com/swiftwasm/carton.git && \
cd carton && \
git checkout "tags/$CARTON_TAG" && \
export CARTON_DEFAULT_TOOLCHAIN=$SWIFT_TAG && \
swift build -c release && \
mv .build/release/carton /usr/bin
FROM ubuntu:22.04 as binaryen
RUN apt-get update && apt-get install -y curl
RUN curl -L -v -o binaryen.tar.gz https://github.com/WebAssembly/binaryen/releases/download/version_105/binaryen-version_105-x86_64-linux.tar.gz
RUN tar xzvf binaryen.tar.gz
FROM ubuntu:22.04 as symbolicator-builder
ARG SYMBOLICATOR_VERSION
RUN apt-get update && apt-get install -y curl
RUN curl -L -v -o wasm-split https://github.com/getsentry/symbolicator/releases/download/$SYMBOLICATOR_VERSION/wasm-split-Linux-x86_64 && chmod +x wasm-split
FROM $SWIFT_DOCKER_IMAGE-slim as swiftwasm-builder
ARG SWIFT_TAG
ARG NODE_VERSION
ARG SWIFT_PLATFORM_SUFFIX=ubuntu22.04_x86_64.tar.gz
ARG OPEN_JDK_VERSION
ARG CYPRESS_VERSION
ARG SWIFT_BIN_URL="https://github.com/swiftwasm/swift/releases/download/swift-$SWIFT_TAG/swift-$SWIFT_TAG-$SWIFT_PLATFORM_SUFFIX"
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install node, OpenJDK-11 JRE (needed to run openapi-generator-cli)
RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION} | bash -
ENV CARTON_ROOT=/root/.carton
# Download and Install swift toolchain (we need snapshot artifact for getting release Foundation library)
RUN CARTON_DEFAULT_TOOLCHAIN_PATH="$CARTON_ROOT/sdk/${SWIFT_TAG}" \
&& curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz \
&& mkdir -p "$CARTON_DEFAULT_TOOLCHAIN_PATH" \
&& tar -xzf swift.tar.gz --directory "$CARTON_DEFAULT_TOOLCHAIN_PATH" --strip-components=1 \
&& ln -s "$CARTON_DEFAULT_TOOLCHAIN_PATH" /opt/swiftwasm
ENV PATH="/opt/swiftwasm/usr/bin:$PATH"
# Install all dependencies also Traditional Chinese, Simplified Chinese, Japanese and Korean fonts (noto-cjk)
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
openjdk-${OPEN_JDK_VERSION}-jre-headless nodejs \
libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb \
binutils \
git \
gnupg2 \
libc6-dev \
libcurl4 \
libedit2 \
libgcc-9-dev \
libpython2.7 \
libsqlite3-0 \
libstdc++-9-dev \
libxml2 \
libz3-dev \
brotli \
pkg-config \
tzdata \
zlib1g-dev \
fonts-noto-cjk \
fonts-noto-color-emoji \
fonts-indic \
fonts-thai-tlwg-ttf \
unzip \
libu2f-udev \
libvulkan1 \
&& rm -rf /var/lib/apt/lists/*
# Install yarn
RUN npm install --global yarn
# Install cypress
RUN npm install --global cypress@${CYPRESS_VERSION}
ARG CHROME_VERSION
ARG CHROME_DRIVER_VERSION
# Install Chrome
# "fake" dbus address to prevent errors
# https://github.com/SeleniumHQ/docker-selenium/issues/87
ENV DBUS_SESSION_BUS_ADDRESS=/dev/null
USER root
# Chrome dependencies
RUN apt-get update && apt-get install -y wget fonts-liberation libappindicator3-1 xdg-utils
# Chrome browser
RUN wget -O /usr/src/google-chrome-stable_current_amd64.deb "http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}-1_amd64.deb"
RUN dpkg -i /usr/src/google-chrome-stable_current_amd64.deb
RUN wget "https://chromedriver.storage.googleapis.com/${CHROME_DRIVER_VERSION}/chromedriver_linux64.zip" \
&& unzip chromedriver_linux64.zip \
&& mv chromedriver /usr/bin/chromedriver \
&& rm chromedriver_linux64.zip
RUN apt-get install -f -y
# Install firefox
ARG FIREFOX_VERSION
RUN wget --no-verbose -O /tmp/firefox.tar.bz2 \
https://download-installer.cdn.mozilla.net/pub/firefox/releases/$FIREFOX_VERSION/linux-x86_64/en-US/firefox-$FIREFOX_VERSION.tar.bz2 \
&& tar -C /opt -xjf /tmp/firefox.tar.bz2 \
&& rm /tmp/firefox.tar.bz2 \
&& ln -fs /opt/firefox/firefox /usr/bin/firefox
# Install latest carton tool
COPY --from=carton-builder /usr/bin/carton /usr/bin/carton
# Install latest binaryen tools (carton still uses some legacy version)
COPY --from=binaryen binaryen-version_105/bin/* /usr/local/bin
COPY --from=symbolicator-builder wasm-split /usr/local/bin
# Print Installed Versions
RUN swift --version
RUN carton --version
RUN node --version
RUN npm --version
RUN npx --version
RUN yarn --version
RUN cypress --version
RUN wasm-opt --version
RUN brotli --version
RUN google-chrome --version
RUN wasm-split --version