Skip to content

Commit 03703a6

Browse files
evqayumi
authored andcommitted
Add Dockerfile for building (#19)
* Add dockerfile for building * Update Dockerfile and README
1 parent 6d4f07c commit 03703a6

File tree

4 files changed

+59
-0
lines changed

4 files changed

+59
-0
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ src
33
.gclient_entries
44
npm-debug.log
55
.gclient
6+
.sccache

Dockerfile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
FROM node:8-stretch
2+
3+
RUN apt-get update && apt-get install -y \
4+
bison \
5+
build-essential \
6+
curl \
7+
g++-multilib \
8+
gcc-multilib \
9+
git \
10+
gperf \
11+
libgnome-keyring-dev \
12+
libnotify-dev \
13+
libssl-dev \
14+
ninja-build \
15+
python-pip \
16+
sudo
17+
18+
RUN npm install -g [email protected]
19+
RUN pip install Jinja2==2.8.1
20+
21+
RUN curl -sSf https://static.rust-lang.org/rustup.sh | sh
22+
RUN cargo install sccache
23+
ENV PATH="/root/.cargo/bin:${PATH}"
24+
RUN echo "sccache = /root/.cargo/bin/sccache" > /root/.npmrc
25+
26+
# BLB source code. Mount ./browser-laptop-bootstrap from the host to here.
27+
WORKDIR /src
28+
VOLUME /src
29+
30+
# Build cache. Mount ./sccache from the host to here.
31+
VOLUME /root/.cache/sccache
32+
33+
CMD bash

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,27 @@ Everything you need to compile [Muon](https://github.com/brave/muon) and run [Br
99
- applies [patches we have](https://github.com/brave/muon/tree/master/patches) for 3rd party code (Chromium, node)
1010

1111
Please [check out our wiki](https://github.com/brave/browser-laptop-bootstrap/wiki) for build instructions and other information.
12+
13+
## Running in Docker
14+
15+
You can compile muon for Linux using a Docker container.
16+
17+
First clone this repo and enter the repo directory:
18+
```
19+
git clone https://github.com/brave/browser-laptop-bootstrap.git
20+
cd browser-laptop-bootstrap
21+
```
22+
23+
Start Docker then build the image from the Dockerfile:
24+
```
25+
docker build -t blb .
26+
```
27+
28+
And run it, mounting the appropriate directories:
29+
```
30+
docker run --rm -it -v $(pwd):/src -v $(pwd)/.sccache:/root/.cache/sccache blb
31+
```
32+
33+
Dependencies are included in the image so there's no need to run `./src/build/install-build-deps.sh`.
34+
35+
Now you can proceed with build scripts such as `npm run init`, `npm run sync -- --all` and `npm run build -- --debug_build=true --official_build=false`. See `./src/out` for the results.

0 commit comments

Comments
 (0)