Skip to content

Commit

Permalink
Add docker image for wasm32-unknown-emscripten
Browse files Browse the repository at this point in the history
- rename emscripten docker image to asmjs
- create wasm32 docker image
  • Loading branch information
malbarbo committed Jun 13, 2017
1 parent 5fe923d commit 9b88a1b
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 95 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ matrix:
- env: IMAGE=dist-x86_64-linux DEPLOY=1 ALLOW_TRY=1
- env: IMAGE=dist-x86_64-musl DEPLOY=1
- env: IMAGE=dist-x86_64-netbsd DEPLOY=1
- env: IMAGE=emscripten
- env: IMAGE=asmjs
- env: IMAGE=i686-gnu
- env: IMAGE=i686-gnu-nopt
- env: IMAGE=x86_64-gnu
Expand Down
44 changes: 44 additions & 0 deletions src/ci/docker/asmjs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM ubuntu:16.04

RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
make \
file \
curl \
ca-certificates \
python \
git \
cmake \
sudo \
gdb \
xz-utils

# dumb-init
COPY scripts/dumb-init.sh /scripts/
RUN sh /scripts/dumb-init.sh

# emscripten
COPY scripts/emscripten.sh /scripts/
RUN bash /scripts/emscripten.sh

# env
ENV PATH=$PATH:/emsdk-portable
ENV PATH=$PATH:/emsdk-portable/clang/e1.37.13_64bit/
ENV PATH=$PATH:/emsdk-portable/emscripten/1.37.13/
ENV PATH=$PATH:/emsdk-portable/node/4.1.1_64bit/bin/
ENV EMSCRIPTEN=/emsdk-portable/emscripten/1.37.13/
ENV BINARYEN_ROOT=/emsdk-portable/clang/e1.37.13_64bit/binaryen/
ENV EM_CONFIG=/emsdk-portable/.emscripten

ENV TARGETS=asmjs-unknown-emscripten

ENV RUST_CONFIGURE_ARGS --target=$TARGETS

ENV SCRIPT python2.7 ../x.py test --target $TARGETS

# cache
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

# init
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
41 changes: 0 additions & 41 deletions src/ci/docker/emscripten/Dockerfile

This file was deleted.

53 changes: 0 additions & 53 deletions src/ci/docker/emscripten/build-emscripten.sh

This file was deleted.

44 changes: 44 additions & 0 deletions src/ci/docker/wasm32/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM ubuntu:16.04

RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
make \
file \
curl \
ca-certificates \
python \
git \
cmake \
sudo \
gdb \
xz-utils

# dumb-init
COPY scripts/dumb-init.sh /scripts/
RUN sh /scripts/dumb-init.sh

# emscripten
COPY scripts/emscripten.sh /scripts/
RUN bash /scripts/emscripten.sh
COPY wasm32/node /usr/local/bin/node

# env
ENV PATH=$PATH:/emsdk-portable
ENV PATH=$PATH:/emsdk-portable/clang/e1.37.13_64bit/
ENV PATH=$PATH:/emsdk-portable/emscripten/1.37.13/
ENV EMSCRIPTEN=/emsdk-portable/emscripten/1.37.13/
ENV BINARYEN_ROOT=/emsdk-portable/clang/e1.37.13_64bit/binaryen/
ENV EM_CONFIG=/emsdk-portable/.emscripten

ENV TARGETS=wasm32-unknown-emscripten

ENV RUST_CONFIGURE_ARGS --target=$TARGETS

ENV SCRIPT python2.7 ../x.py test --target $TARGETS

# cache
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

# init
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
18 changes: 18 additions & 0 deletions src/ci/docker/wasm32/node
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
# Copyright 2017 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.

path="$(dirname $1)"
file="$(basename $1)"

shift

cd "$path"
exec /node-v8.0.0-linux-x64/bin/node "$file" "$@"

0 comments on commit 9b88a1b

Please sign in to comment.