-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlibnode.Dockerfile
142 lines (117 loc) · 5.63 KB
/
libnode.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
138
139
140
141
142
FROM quay.io/knawd/libnode:ubuntu18 as ubuntu18builder
ENV WASMTIME_VERSION=v5.0.0
RUN curl https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- -e all -p /usr/local --version=0.11.2
WORKDIR /
RUN git clone --depth 1 -b 1.8 --recursive https://github.com/containers/crun.git
WORKDIR /crun
RUN ./autogen.sh
RUN ./configure --with-wasmedge --enable-embedded-yajl
RUN make
# RUN ./crun --version
RUN mv crun crun-wasmedge
RUN curl -L https://github.com/bytecodealliance/wasmtime/releases/download/${WASMTIME_VERSION}/wasmtime-${WASMTIME_VERSION}-$(uname -m)-linux-c-api.tar.xz | tar xJf - -C /
RUN cp -R /wasmtime-${WASMTIME_VERSION}-$(uname -m)-linux-c-api/* /usr/local/
WORKDIR /crun
RUN ./configure --with-wasmtime --enable-embedded-yajl
RUN make
# RUN ./crun --version
RUN mv crun crun-wasmtime
WORKDIR /wasm_nodejs
RUN git clone --depth 1 -b node-wasm-experiment https://github.com/mhdawson/crun.git
WORKDIR /wasm_nodejs/crun
RUN cp /wasm_nodejs/node/out/Release/libnode.so.* /lib64/libnode.so
RUN cp /wasm_nodejs/node/src/js_native_api.h /usr/include/js_native_api.h
RUN cp /wasm_nodejs/node/src/js_native_api_types.h /usr/include/js_native_api_types.h
RUN cp /wasm_nodejs/node/src/node_api.h /usr/include/node_api.h
RUN cp /wasm_nodejs/node/src/node_api_types.h /usr/include/node_api_types.h
RUN ./autogen.sh
RUN ./configure --with-wasm_nodejs --enable-embedded-yajl
RUN make
# RUN ./crun --version
RUN mv crun crun-wasm-nodejs
FROM quay.io/knawd/libnode:ubuntu20 as ubuntu20builder
ENV WASMTIME_VERSION=v5.0.0
RUN curl https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- -e all -p /usr/local --version=0.11.2
WORKDIR /
RUN git clone --depth 1 -b 1.8 --recursive https://github.com/containers/crun.git
WORKDIR /crun
RUN ./autogen.sh
RUN ./configure --with-wasmedge --enable-embedded-yajl
RUN make
# RUN ./crun --version
RUN mv crun crun-wasmedge
RUN curl -L https://github.com/bytecodealliance/wasmtime/releases/download/${WASMTIME_VERSION}/wasmtime-${WASMTIME_VERSION}-$(uname -m)-linux-c-api.tar.xz | tar xJf - -C /
RUN cp -R /wasmtime-${WASMTIME_VERSION}-$(uname -m)-linux-c-api/* /usr/local/
WORKDIR /crun
RUN ./configure --with-wasmtime --enable-embedded-yajl
RUN make
# RUN ./crun --version
RUN mv crun crun-wasmtime
WORKDIR /wasm_nodejs
RUN git clone --depth 1 -b node-wasm-experiment https://github.com/mhdawson/crun.git
WORKDIR /wasm_nodejs/crun
RUN cp /wasm_nodejs/node/out/Release/libnode.so.* /lib64/libnode.so
RUN cp /wasm_nodejs/node/src/js_native_api.h /usr/include/js_native_api.h
RUN cp /wasm_nodejs/node/src/js_native_api_types.h /usr/include/js_native_api_types.h
RUN cp /wasm_nodejs/node/src/node_api.h /usr/include/node_api.h
RUN cp /wasm_nodejs/node/src/node_api_types.h /usr/include/node_api_types.h
RUN ./autogen.sh
RUN ./configure --with-wasm_nodejs --enable-embedded-yajl
RUN make
# RUN ./crun --version
RUN mv crun crun-wasm-nodejs
FROM quay.io/knawd/libnode:rocky8 as rhel8builder
ENV WASMTIME_VERSION=v5.0.0
RUN curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- -e all -p /usr/local --version=0.11.2
RUN dnf install -y systemd-devel yajl-devel libseccomp-devel pkg-config libgcrypt-devel \
glibc-static python3-libmount libtool libcap-devel
WORKDIR /
RUN git clone --depth 1 -b 1.8 --recursive https://github.com/containers/crun.git
WORKDIR /crun
RUN ./autogen.sh
RUN ./configure --with-wasmedge --enable-embedded-yajl
RUN make
RUN ./crun --version
RUN mv crun crun-wasmedge
### wasmtime
RUN curl -L https://github.com/bytecodealliance/wasmtime/releases/download/${WASMTIME_VERSION}/wasmtime-${WASMTIME_VERSION}-$(uname -m)-linux-c-api.tar.xz | tar xJf - -C /
RUN cp -R /wasmtime-${WASMTIME_VERSION}-$(uname -m)-linux-c-api/* /usr/local/
WORKDIR /crun
RUN ./configure --with-wasmtime --enable-embedded-yajl
RUN make
RUN ./crun --version
RUN mv crun crun-wasmtime
### wasm_nodejs doesn't use the default crun so we are creating subfolders
WORKDIR /wasm_nodejs
RUN git clone --depth 1 -b node-wasm-experiment https://github.com/mhdawson/crun.git
WORKDIR /wasm_nodejs/crun
RUN cp /wasm_nodejs/node/out/Release/libnode.so.* /lib64/libnode.so
RUN cp /wasm_nodejs/node/src/js_native_api.h /usr/include/js_native_api.h
RUN cp /wasm_nodejs/node/src/js_native_api_types.h /usr/include/js_native_api_types.h
RUN cp /wasm_nodejs/node/src/node_api.h /usr/include/node_api.h
RUN cp /wasm_nodejs/node/src/node_api_types.h /usr/include/node_api_types.h
RUN ./autogen.sh
RUN ./configure --with-wasm_nodejs --enable-embedded-yajl
RUN make
# RUN ./crun --version
RUN mv crun crun-wasm-nodejs
FROM registry.access.redhat.com/ubi9/ubi as ubi9build
RUN yum install -y gcc openssl-devel && \
rm -rf /var/cache/dnf && \
curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH=/root/.cargo/bin:${PATH}
COPY manager /app-build/
WORKDIR "/app-build"
RUN cargo build --release
RUN cargo test --release
FROM registry.access.redhat.com/ubi9/ubi
WORKDIR "/vendor/rhel8"
COPY --from=rhel8builder /usr/local/lib/libwasmedge.so.0 /lib64/libnode.so /usr/local/lib/libwasmtime.so /crun/crun-wasmedge /crun/crun-wasmtime /wasm_nodejs/crun/crun-wasm-nodejs ./
WORKDIR "/vendor/ubuntu_20_04"
COPY --from=ubuntu20builder /usr/local/lib/libwasmedge.so.0 /lib64/libnode.so /usr/local/lib/libwasmtime.so /crun/crun-wasmedge /crun/crun-wasmtime /wasm_nodejs/crun/crun-wasm-nodejs ./
WORKDIR "/vendor/ubuntu_18_04"
COPY --from=ubuntu18builder /usr/local/lib/libwasmedge.so.0 /lib64/libnode.so /usr/local/lib/libwasmtime.so /crun/crun-wasmedge /crun/crun-wasmtime /wasm_nodejs/crun/crun-wasm-nodejs ./
WORKDIR "/app"
COPY --from=ubi9build /app-build/target/release/manager ./
RUN /app/manager version
CMD ["/app/manager"]