A docker container to compile the lastest version of Netatalk in order to run a Time Machine server.
To download the docker container and execute it, simply run:
$ docker run -h timemachine --name timemachine --restart=unless-stopped -d -v /shares:/shares -it -p 548:548 -p 636:636 scrapes/docker-timemachine
To add users, just run this command:
$ docker exec timemachine add-account USERNAME PASSWORD MOUNT_POINT SHARE_NAME TIMEMACHINE(yes,no) [VOL_SIZE_MB]
Just to add a user without a share:
$ docker exec timemachine add-account USERNAME PASSWORD
To add a user to a share or create a new share:
$ docker exec timemachine add-share VALID_USERS(user1,user2 ...) MOUNT_POINT SHARE_NAME TIMEMACHINE(yes,no) [VOL_SIZE_MB]
But take care that:
MOUNT_POINT
shouldn´t be an absolute path, it will create an new directory inside your storage(shares) folder.VOL_SIZE_MB
is an optional parameter. It indicates the max volume size for that user, as long as the Time Machine flag is used.
Now you have a docker instance running netatalk
.
You can configure the container using environment variables (for example, if you use a docker-compose
environment).
There are these environment variables:
- AFP_LOGIN: User name
- AFP_PASSWORD: User password
- AFP_NAME: Name of the volume
- AFP_SIZE_LIMIT: Size in MB of the volume (optional)
Using these variables, the container will create a user at boot time (only one per container).
Avahi daemon is commonly used to help your computers to find the services provided by a server.
Avahi isn't built into this Docker image because, due to Docker's networking limitations, Avahi can't spread it's messages to announce the services.
If you want to enable this feature, you can install Avahi daemon on your host following these steps (Ubuntu version):
- Install
avahi-daemon
: runsudo apt-get install avahi-daemon avahi-utils
- Copy the file from
avahi/nsswitch.conf
to/etc/nsswitch.conf
- Copy the service description file from
avahi/afpd.service
to/etc/avahi/services/afpd.service
- Restart Avahi's daemon:
sudo /etc/init.d/avahi-daemon restart
But why install this on your host and not in the container? Because if you don't do it this way, the discovery message won't be able to reach your computers.
As the image has been started using the --restart=always
flag, it will start when the computers boots up.
- Óscar de Arriba ([email protected])
- Daniel Iñigo ([email protected])
- Josef Friedrich (@Josef-Friedrich)