-
Notifications
You must be signed in to change notification settings - Fork 15
/
Containerfile
68 lines (36 loc) · 1.4 KB
/
Containerfile
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
ARG rust_ver
FROM docker.io/library/rust:${rust_ver}
LABEL rust_ver="${rust_ver}"
ARG check_container_dependencies_updated="true"
ARG binaryen_ver="version_117"
ENV CHECK_DEPENDENCIES_UPDATED="true"
VOLUME ["/artifacts"]
VOLUME ["/code"]
VOLUME ["/platform"]
RUN ["apt-get", "update"]
RUN ["apt-get", "install", "-y", "coreutils", "sed", "tar", "wget"]
RUN "rustup" "default" | "sed" "s/ (default)[[:space:]]\{0,\}//" \
> "/rust-version"
RUN "echo" "${binaryen_ver}" | "tr" "-d" "\n" > "/binaryen-version"
RUN ["rustup", "target", "add", "wasm32-unknown-unknown"]
ADD "./tools/" "/tools/"
WORKDIR "/tools/"
RUN "[" "${check_container_dependencies_updated}" "=" "false" "]" || \
"cargo" "update" "--locked"
RUN "cargo" "+$(cat "/rust-version")" "install" "--path" "/tools/cargo-each/"
WORKDIR "/"
RUN ["rm", "-rf", "/tools/"]
RUN ["mkdir", "/binaryen/"]
WORKDIR "/binaryen/"
RUN "wget" "-O" "binaryen.tar.gz" "https://github.com/WebAssembly/binaryen/\
releases/download/${binaryen_ver}/binaryen-${binaryen_ver}-x86_64-linux.tar.gz"
RUN ["tar", "-xf", "binaryen.tar.gz"]
RUN "mv" "-t" "/usr/bin/" "./binaryen-${binaryen_ver}/bin/wasm-opt"
WORKDIR "/"
RUN ["rm", "-rf", "/binaryen/"]
RUN ["mkdir", "/build/"]
ADD "./scripts/build-and-optimize.sh" "/build/build.sh"
RUN ["chmod", "-R", "a+rx-w", "/build/"]
RUN ["mkdir", "/target/"]
RUN ["mkdir", "/temp-artifacts/"]
CMD ["sh", "/build/build.sh"]