forked from msizanoen/wasmer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build
executable file
·79 lines (68 loc) · 1.45 KB
/
build
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
#!/bin/bash
# Wasmer build tool
#
# This is a script to build Wasmer in a Docker sandbox.
#
# To use the script, first make sure Docker is installed. Then build the
# sandbox image with:
#
# docker build --file Dockerfile.build --tag wasmer-build .
#
# After the sandbox image is built successfully, you can run commands in it
# with this script.
#
# For example, to build Wasmer, run:
#
# ./build make
#
# To test Wasmer, run:
#
# ./build make test
#
# and so on.
docker_hostname="wasmer-build"
docker_img="wasmer-build"
docker_workdir="/wasmer"
docker_args=(
#
# General config.
#
--hostname=${docker_hostname}
--interactive
--network=host
--rm
--tty
#
# User and group config.
#
# Use the same user and group permissions as host to make integration
# between host and container simple.
#
--user "$(id --user):$(id --group)"
--volume "/etc/group:/etc/group:ro"
--volume "/etc/passwd:/etc/passwd:ro"
--volume "/etc/shadow:/etc/shadow:ro"
#
# Time zone config.
#
# Use the same time zone as the host.
#
--volume "/etc/localtime:/etc/localtime:ro"
#
# Linux capabilities.
#
# Add SYS_PTRACE capability to the container so that people can run
# `strace'.
#
--cap-add SYS_PTRACE
#
# Source directory.
#
--workdir=${docker_workdir}
--volume "$(pwd):${docker_workdir}:z"
#
# Environment variables.
#
--env "CARGO_HOME=${docker_workdir}/.cargo"
)
docker run ${docker_args[@]} ${docker_img} $*