https://github.com/alexanderwolz/docker-platform
Platform for easy management of Docker Containers on single remote hosts
https://github.com/alexanderwolz/docker-platform
backup backups build containers deploy docker packages platform restore restore-data rsynch ssh
Last synced: 3 months ago
JSON representation
Platform for easy management of Docker Containers on single remote hosts
- Host: GitHub
- URL: https://github.com/alexanderwolz/docker-platform
- Owner: alexanderwolz
- License: apache-2.0
- Created: 2023-03-11T07:40:06.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-06T19:00:58.000Z (over 1 year ago)
- Last Synced: 2025-05-29T03:46:34.561Z (about 1 year ago)
- Topics: backup, backups, build, containers, deploy, docker, packages, platform, restore, restore-data, rsynch, ssh
- Language: Shell
- Homepage:
- Size: 46.9 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Docker Platform






## Introduction
Platform for easy management of Docker Containers on
single remote hosts
## Docker Package
The core idea behind this platform is a so-called "Docker Package" folder that consists of several files, including a metadata file named ```docker.pkg```. This package is synched to the remote host using rSync and can be executed according the given ```docker-compose.yml```. Additionally a pre- and a post-script can be executed before and after starting the Docker services.
The metadata file contains:
- ```NAME```: The name of the package (used as ID for sync)
- ```DESCRIPTION```: Description of the package
- ```ADDITIONAL_FILES```: Comma-separated list of files and folders that should be synched to the remote server
- ```PRE_HOOK```: Script file that is executed before starting the services
- ```POST_HOOK```: Script file that is executed after services have been startet
## Setup
### General Setup
The remote host needs a user that belongs to the ```docker```-group. For convenience, RSA keys of the local machine should be uploaded using ```ssh-copy-id user@host``` and SSHd should allow ```PubkeyAuthentication```, otherwise the scipts are forced to enter a password on each connection.
### Linux Packages
The platform scripts require following pre-installed packages:
- docker-ce (> 5:23.0.1)
- docker-ce-cli (> 5:23.0.1)
- docker-compose (>2.16)
- containerd.io (>1.6)
- zip
- rsynch
### Environment
The following environment variables must be set and exported (e.g. in ~/.profile of each eligible user)
```
export DOCKER_PLATFORM_HOME="/docker"
export DOCKER_PLATFORM_BACKUPS="/backups"
```
This toolchain has been successfully tested on Debian GNU/Linux 11 (bullseye), other Linux distributions may be supported in the future too.
### Config files
Folder ```conf``` contains the configurations for ```deploy.sh``` and ```build.sh```. They must be customized for each server environment accordingly.
## Binaries
Folder ```bin``` contains a variety of toolchain scripts, of which some of them are synched to the remote host.
### Local Binaries
- **deploy.sh** - Master script for deploying packages, scripts and config files
- **build.sh** - Creates and pushes Docker images according to the specified build folder
### Remote Binaries
The following scripts are synched to the remote host:
- **armageddon.sh** - Script for tearing down the whole Docker environment
- **backup.sh** - Backs up all container packages, volumes and environment variables
- **bootstrap.sh** - Creates external networks and volumes
- **build.sh** - Creates docker images on localhost and pushes them to a (private) registry
- **cleanup_logs.sh** - Truncates docker log files and removes rotated ones
- **common.sh** - Just a sourcable script holding common functions
- **deploy.sh** - Uploads given package files to remote server and triggers ```run.sh``` on remote server
- **hosts.sh** - Updates and writes docker hostnames to the remote server's host config
- **restore.sh** - Restores packages, volumes and environment variables by a given backup file
- **run.sh** - Runs a given Docker package and executes pre- and post-scripts
- **stop.sh** - Stops a given Docker package
- - -
Made with ❤️ in Bavaria
© 2018-2024, Alexander Wolz