lobaro / restic-backup-docker

A docker container to automate backups with restic
Apache License 2.0
330 stars 114 forks source link

restic-backup-docker should use the hostname of the docker host system #43

Closed technicalguy closed 4 years ago

technicalguy commented 4 years ago
$ echo $HOSTNAME
my-nas-server
$ docker -it restic_restic_1 sh
# echo $HOSTNAME
786db61fb11d

This means that when I go to restic-mount my backups inside the hosts directory I see 786db61fb11d when I want to see my-nas-server.

niondir commented 4 years ago

You should be able to set the hostname of the docker container to something specific. See also: https://serverfault.com/questions/590191/how-to-specify-hostname-for-the-running-container

$ docker run -h foo.bar.baz -i -t ubuntu bash
root@foo:/# hostname
foo
root@foo:/# hostname -d
bar.baz
root@foo:/# hostname -f
foo.bar.baz
technicalguy commented 4 years ago

Ahh, of course, thanks! Is there somewhere in the documentation that it is worth mentioning this?

niondir commented 4 years ago

The --hostname option is documented in the readme.