Coder Social home page Coder Social logo

timemachinesambadocker's Introduction

TimeMachine on Samba for Docker

In this repo you will find instructions and resources on how to run a Docker container with Samba 4 to support Apple's TimeMachine. You will also be able to build your own Docker image if you don't want to use the pre-built one.

Features:

  • Alpine Linux based.
  • Avahi discovery service configured.
  • Configuration options:
    • Group name & ID
    • User name & ID
    • Samba user password
    • Limit storage size

How to run the container

Via docker run

docker run -d --net=host \
            --volume /opt/timemachine:/timemachine/ \
            --volume /etc/localtime:/etc/localtime:ro \
            -e TM_PWD=notsosecretpassword \
            --restart=always \
            --name=timemachine default50/timemachinesambadocker

For more information about the options for docker run visit https://docs.docker.com/engine/reference/run/

Via docker-compose

You can modify the parameters in the sample docker-compose.sample.yml file to suit your needs and then rename it to docker-compose.yml. To launch the service container just do docker-compose up -d in the same directory of of the composer file.

Note: you may need to install compose. Check https://docs.docker.com/compose/install/

Environment variables

This is a summary of the environment variables that can be used to override any of the default values.

Variable Function Default.
TM_USER POSIX user name inside container timemachine
TM_GROUP POSIX group name inside container timemachine
TM_UID POSIX user ID inside container 1000
TM_GID POSIX group ID inside container 1000
TM_PWD Samba password timemachine
TM_SIZE Time Machine storage size limit (MB) 512000

How to build your own image

You can always build your own image instead of using the image provided through my public repository.

It's as simple as doing docker build . in the root of the repository, but it's better if you tag the image with something like this:

docker build --tag default50/timemachinesambadocker .

Advanced

It is important to note that the files that Samba will create in the volume that you specify will have the same file UID and GID that you set as TM_UID and TM_GID. This is only relevant if you run this container as an unprivileged user and you want the files to be accessible by that same user.

Alpine's busybox package does not support UID/GIDs higher than 256000 (see this StackOverflow post), that's why I'm using the shadow package here.

Credits

The contents here were mostly obtained from willtho89/docker-samba-timemachine's repository with some improvements.

And according to willtho89's own words:

It's mostly based on u/KervyN's HowTo and dperson's Samba docker container.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.