Skip to content

Commit 9ebcece

Browse files
committed
Removed all functions with cron and automating the adding of books to reduce the size of the container.
1 parent 718a94f commit 9ebcece

File tree

4 files changed

+33
-29
lines changed

4 files changed

+33
-29
lines changed

Dockerfile

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
11
FROM fedora:23
22
MAINTAINER Bradley Leonard <[email protected]>
33

4-
# install basic development tools
5-
#RUN dnf -y update\
6-
# && dnf clean all
7-
84
# install calibre cronie
9-
RUN dnf -y install calibre cronie
5+
RUN dnf -y install calibre-2.49.0
106

117
# create directories
128
#RUN mkdir /library & mkdir /addbooks & mkdir /scripts
139
RUN mkdir /data & mkdir /scripts
1410

15-
# add crontab
16-
ADD crontab /scripts/crontab
17-
1811
# add add-books.sh
1912
ADD add-books.sh /scripts/add-books.sh
2013
RUN chmod 755 /scripts/add-books.sh

README.md

+32-7
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,47 @@
11
# calibre
22

3-
This contains the docker file and all necessary files to build a docker container for calibre
3+
This contains the docker file and all necessary files to build a docker container for calibre.
4+
5+
Calibre (https://calibre-ebook.com) is probably the best e-book management system out there. This docker container will run the
6+
server portion only.
47

58
### Preperation
9+
610
Before running the container, you'll need to have the following directories predefined on the container host:
711
```sh
812
library
913
addbooks
1014
```
11-
The library directory will hold your books & database. addbooks will be used to add books to your library on a periodic basis. I used:
15+
The library directory will hold your books & database. addbooks will be used to add books to your library. I used:
1216
```sh
13-
/data/library
14-
/data/addbooks
17+
/home/books/library
18+
/home/books/addbooks
1519
```
16-
for the instructions below. Just make sure you create it prior to starting the container.
20+
for the instructions below. Just make sure you create them prior to starting the container.
21+
1722
### To run the container:
23+
24+
```sh
25+
docker run -d --name=calibre -v /home/books:/data:Z -p 8080:8080 bcleonard/calibre
26+
```
27+
28+
### To access Calibre:
29+
1830
```sh
19-
docker run -v /data:/data -p 8080:8080 bcleonard/calibre
31+
http://<docker_host>:8080
2032
```
21-
### Notes:
33+
34+
### To add books to the library.
35+
36+
First add your books to /home/books/addbooks, one book (all formats) per directory. Then run the following command:
37+
```sh
38+
docker exec calibre /scripts/add-books.sh
39+
```
40+
All the books in /home/books/addbooks will be added to the library, removed from the /home/books/addbooks directory and calibre notified.
41+
42+
### Notes/Caveats/Issues:
43+
44+
1. Previous versions of the container used to automatically run the add-books.sh script hourly via cron. In an effect to reduce the image size and with the available of the docker exec command, that functionality has been removed.
45+
2. I recommend running the add-scripts.sh ad-hoc, when necessary. You can schedule it via the host (via cron, etc).
46+
3. I recommend that you only pull versioned containers, not latest.
2247

crontab

-4
This file was deleted.

startup.sh

-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
#!/bin/bash
22

3-
#
4-
# add crontab for root
5-
#
6-
crontab /scripts/crontab
7-
8-
#
9-
# start crond
10-
#
11-
/usr/sbin/crond
12-
133
#
144
# start calibre-server
155
#

0 commit comments

Comments
 (0)