-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdocker-provision.sh
More file actions
executable file
·36 lines (27 loc) · 956 Bytes
/
Copy pathdocker-provision.sh
File metadata and controls
executable file
·36 lines (27 loc) · 956 Bytes
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
#!/bin/sh -eux
# docker-provision.sh --- Provisioning script for a Docker container w/GitBook.
GITBOOK_CLI_VERSION="2.3.0"
# update Apt repositories
apt-get update
# install dependencies
apt-get install -y --no-install-recommends git calibre
# install GitBook CLI
npm install -g gitbook-cli@$GITBOOK_CLI_VERSION
# install the latest version...gets installed in $HOME (i.e. /root)
gitbook fetch latest
# add gitbook wrapper script
cat <<EOF > /usr/local/bin/gitbookw
#!/bin/sh -eu
# gitbookw --- Wrapper for gitbook that autoinstalls plugins.
gitbook install
gitbook \$@
EOF
chmod +x /usr/local/bin/gitbookw
# clean up (apt)
apt-get clean # remove packages that have been downloaded, installed, and no longer needed
apt-get autoclean # remove archived packages that can no longer be downloaded
apt-get autoremove
# clean up (misc.)
rm -rf /var/lib/apt/lists/* /var/cache/apt/* /root/.npm /tmp/npm*
# Add empty docs directory
mkdir -p /docs