File: docker-notes.txt

package info (click to toggle)
tuptime 5.2.5
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 416 kB
  • sloc: python: 1,951; sh: 545; makefile: 5
file content (39 lines) | stat: -rw-r--r-- 1,620 bytes parent folder | download | duplicates (2)
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
37
38
39
==========================
| Docker notes - Tuptime |
==========================

Tuptime could be executed inside a container via Docker.

It only requires the creation of the path /var/lib/tuptime/ on the host to store the
database file, which is done by Systemd automatically. All other runtime requirements
reside inside the container and their execution is managed via Systemd too.

The container is built over Alpine image, because their small footprint. But it could
be built over any other OS image.

Begin with this installation method getting the repo and creating the container:

    # git clone https://github.com/rfmoz/tuptime.git
    # cd tuptime/misc/docker/
    # docker build  -t 'tuptime' .

Copy the systemd files, the main service and the sync ones for the scheduled execution:

    # install -m 644 tuptime-docker.service /etc/systemd/system/
    # install -m 644 tuptime-sync-docker.* /etc/systemd/system/
    # systemctl daemon-reload
    # systemctl enable tuptime-docker.service && systemctl start tuptime-docker.service
    # systemctl enable tuptime-sync-docker.timer && systemctl start tuptime-sync-docker.timer

Also, create an alias for an easy execution (Maybe set it inside your ~/.profile or
~/.bashrc):

    # alias tuptime='/usr/bin/docker run --network none --rm -v /var/lib/tuptime/:/var/lib/tuptime/ tuptime'
    # tuptime

That's all.

Note: If the same host has a local Tuptime installation, disable their Systemd execution:

    # systemctl disable tuptime.service && systemctl stop tuptime.service
    # systemctl disable tuptime-sync.timer && systemctl stop tuptime-sync.timer