File tree 3 files changed +30
-18
lines changed
3 files changed +30
-18
lines changed Original file line number Diff line number Diff line change
1
+ # ## HELP
2
+
3
+ .PHONY : help
4
+ help : # # Print help
5
+ @egrep " (^### |^\S+:.*##\s)" Makefile | sed ' s/^###\s*//' | sed ' s/^\(\S*\)\:.*##\s*\(.*\)/ \1 - \2/'
6
+
7
+ # ## DOCKER
8
+
9
+ .PHONY : run
10
+ run : image # # docker run ...
11
+ (docker stop linux-insides-book 2>&1 ) > /dev/null || true
12
+ docker run --detach --rm -p 4000:4000 --name linux-insides-book --hostname linux-insides-book linux-insides-book
13
+
14
+ .PHONY : image
15
+ image : # # docker image build ...
16
+ docker image build --rm --squash --label linux-insides --tag linux-insides-book:latest -f Dockerfile . 2> /dev/null || \
17
+ docker image build --rm --label linux-insides --tag linux-insides-book:latest -f Dockerfile .
18
+
19
+ # ## LAUNCH BROWSER
20
+
21
+ .PHONY : browse
22
+ browse : # # Launch broweser
23
+ @timeout 60 sh -c ' until nc -z 127.0.0.1 4000; do sleep 1; done' || true
24
+ @ (uname | grep Darwin > /dev/null) && open http://127.0.0.1:4000 || true
25
+ @ (uname | grep Linux > /dev/null) && xdg-open http://127.0.0.1:4000 || true
Original file line number Diff line number Diff line change @@ -63,28 +63,14 @@ In order to run your own copy of the book with gitbook within a local container:
63
63
systemctl restart docker.service
64
64
```
65
65
66
- 2 . Build container image
66
+ 2 . Run docker image
67
67
``` bash
68
- docker image build \
69
- --rm --squash \
70
- --label linux-insides \
71
- --tag linux-insides-book:latest \
72
- -f Dockerfile .
68
+ make run
73
69
```
74
70
75
- 3 . Create and run book in local container
76
- ``` bash
77
- docker run \
78
- --detach \
79
- --rm \
80
- -p 4000:4000 \
81
- --name linux-insides-book \
82
- --hostname linux-insides-book \
83
- linux-insides-book
84
- ```
71
+ 3 . Open your local copy of linux insides book under this url
72
+ http://localhost:4000 or run ` make browse `
85
73
86
- 4 . Open your local copy of linux insides book under this url
87
- http://localhost:4000
88
74
89
75
Contributions
90
76
--------------
Original file line number Diff line number Diff line change @@ -134,3 +134,4 @@ Thank you to all contributors:
134
134
* [ Yuxin Wu] ( https://github.com/chaffz )
135
135
* [ Biao Ding] ( https://github.com/SmallPond )
136
136
* [ Arfy slowy] ( https://github.com/slowy07 )
137
+ * [ Dexter Plameras] ( https://github.com/dexterp )
You can’t perform that action at this time.
0 commit comments