Skip to content
This repository was archived by the owner on May 27, 2019. It is now read-only.

Commit f5eaf01

Browse files
jayme-githubmaximbaz
authored andcommitted
Add Dockerfile (#144)
This can be used to build browserpass (go and js) with docker-powers: docker build -t browserpass-dev . docker run --rm -v "$(pwd)":/browserpass browserpass-dev
1 parent 3673b2c commit f5eaf01

File tree

3 files changed

+39
-1
lines changed

3 files changed

+39
-1
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ chrome/inject.js
1414
node_modules
1515
.vagrant/
1616
vendor/
17+
.*.swp

CONTRIBUTING.md

+23-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CONTRIBUTING
22

3-
You will need Node, [Yarn](https://yarnpkg.com/), Golang and [dep](https://github.com/golang/dep) installed.
3+
You will need Docker or Node, [Yarn](https://yarnpkg.com/), Golang and [dep](https://github.com/golang/dep) installed.
44

55
## To build
66
- Run `make` to compile both front-end and back-end code
@@ -24,6 +24,28 @@ The commands above will generate unpacked extensions for both Firefox and Chrome
2424
- Click `Load temporary add-on`
2525
- Select `browserpass/firefox` directory
2626

27+
## Build using Docker
28+
29+
The [Dockerfile](Dockerfile) will set up a docker image suitable for running basic make targets such as building frontend and backend.
30+
31+
The `crx` target is not supported by now (therefore `release` target will not work).
32+
33+
To build the docker image run the following command in project root:
34+
```shell
35+
docker build -t browserpass-dev .
36+
```
37+
38+
To build browserpass (frontend and backend) via docker, run the following from project root:
39+
```shell
40+
docker run --rm -v "$(pwd)":/browserpass browserpass-dev
41+
```
42+
43+
If you only want to build front-end or backend, run one of the following:
44+
```shell
45+
docker run --rm -v "$(pwd)":/browserpass browserpass-dev js
46+
docker run --rm -v "$(pwd)":/browserpass browserpass-dev browserpass
47+
```
48+
2749
## Setting up a Vagrant build environment and building the Linux binary
2850

2951
Vagrant will set up a virtual machine with all dependencies installed for you. Your local working directory is shared into the VM.

Dockerfile

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM golang:1.8-alpine3.6
2+
3+
ENV CGO_ENABLED=0 \
4+
APP_PATH="$GOPATH/src/github.com/dannyvankooten/browserpass"
5+
# New ENV statement as this depends on APP_PATH
6+
ENV PATH="$PATH:$APP_PATH/node_modules/.bin/"
7+
8+
RUN apk add --no-cache bash git make tar yarn zip && \
9+
go get -u github.com/golang/dep/cmd/dep && \
10+
mkdir -p $APP_PATH && \
11+
ln -s $APP_PATH /
12+
13+
WORKDIR $APP_PATH
14+
15+
ENTRYPOINT ["make"]

0 commit comments

Comments
 (0)