Dockerized Apple Software Update Services (Reposado + Margarita)
This repo uses Docker and Docker Compose to automate the deployment of Apple Software Update Services (Apple SUS), which consists of Reposado and Margarita.
This is more than just an Apple SUS image. Included in this repo is everything you need to get Apple SUS up and running as quickly as possible and a pre-configured backup and restoration solution.
Note: some of the commands in these guides may require root access to your system. If that is the case, either run the commands while logged in to the root account, or simulate a login to the root account using sudo -i
. Due to the way environment variables are passed on some systems, typing sudo
before each command is not a supported method of running the commands in these guides with root access.
-
Ensure the following are installed on your system:
- Docker
- Docker Compose Warning: installing as a container is not supported.
git
tar
-
Clone this repo to a location on your system. Note: in all of the guides on this page, it is assumed the repo is cloned to
/srv/docker/applesus
.git clone https://github.com/ianharrier/docker-applesus.git /srv/docker/applesus
-
Set the working directory to the root of the repo.
cd /srv/docker/applesus
-
Create the
.env
file using.env.template
as a template.cp .env.template .env
-
Using a text editor, read the comments in the
.env
file, and make modifications to suit your environment.vi .env
-
Start Apple SUS in the background.
docker-compose up -d
Note: for more detailed information, refer to the official Reposado docs.
-
Optionally, the first time you use Apple SUS, you can force a synchronization instead of waiting for the first scheduled synchronization to occur.
docker-compose exec cron reposado-sync
-
Navigate to the admin console at
http://<Docker-host-IP>:80/admin
(or whatever port you specified in the.env
file). -
Create new branches and approve updates.
-
Set the
CatalogURL
tohttp://<Docker-host-IP>:80/index_<branch-name>.sucatalog
on a macOS client. URL rewrites are supported by this image.
Warning: the upgrade process will immediately stop and upgrade the current production environment. The application stack will be unavailable while it is being upgraded.
-
Set the working directory to the root of the repo.
cd /srv/docker/applesus
-
Run the upgrade script.
./scripts/app-upgrade.sh
-
Set the working directory to the root of the repo.
cd /srv/docker/applesus
-
Run the backup script.
docker-compose exec cron app-backup
Warning: the restoration process will immediately stop and delete the current production environment. You will not be asked to save any data before the restoration process starts.
-
Set the working directory to the root of the repo.
cd /srv/docker/applesus
-
List the available files in the
backups
directory.ls -l backups
-
Specify a file to restore in the following format:
./scripts/app-restore.sh <backup-file-name>
For example:
./scripts/app-restore.sh 20170501T031500+0000.tar.gz
-
Set the working directory to the root of the repo.
cd /srv/docker/applesus
-
Remove the application stack.
docker-compose down
-
Delete the repo. Warning: this step is optional. If you delete the repo, all of your Apple SUS data, including backups, will be lost.
rm -rf /srv/docker/applesus