-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (25 loc) · 1.19 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
FROM ghcr.io/r-wasm/flang-wasm:main
ENV PATH="/opt/emsdk:/opt/emsdk/upstream/emscripten:${PATH}"
ENV EMSDK="/opt/emsdk"
ENV WEBR_ROOT="/opt/webr"
ENV EM_NODE_JS="/usr/bin/node"
ENV EMFC="/opt/flang/host/bin/flang-new"
# Install nodeJS
RUN apt-get update && apt-get install nodejs npm -y
RUN git clone https://github.com/r-wasm/webr /opt/webr
WORKDIR /opt/webr
COPY datatool /datatool
# Update npm metadata
RUN sed -i.bak 's|"name": "webr"|"name": "@r-universe/webr"|' src/package.json &&\
sed -i.bak "s|\"version\":.*|\"version\": \"$(date +'%Y.%m.%d')\",|" src/package.json &&\
curl -sSOL https://github.com/r-universe-org/webr-bundle/raw/master/README.md &&\
cat src/package.json
RUN ./configure
# Add packages to the bundle
RUN git clone --depth 1 https://github.com/cran/jsonlite packages/jsonlite &&\
git clone --depth 1 https://github.com/ropensci/writexl packages/writexl &&\
git clone --depth 1 https://github.com/cran/data.table packages/data.table &&\
git clone --depth 1 https://github.com/cran/zip packages/zip && \
cp -Rf /datatool packages/datatool && \
sed -i.bak 's/PKGS = webr/PKGS = webr jsonlite writexl data.table zip datatool/' packages/Makefile
RUN make