Giter VIP home page Giter VIP logo

docker-platform's Introduction

Docker Platform

GitHub release (latest by date) GitHub GitHub GitHub GitHub code size in bytes GitHub all releases

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
  • common.sh - Just a sourcable script holding common functions
  • hosts.sh - Updates and writes docker hostnames to the remote server's host config
  • networks.sh - Creates external networks according to the network configuration in /etc/networks.conf
  • 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-2023, Alexander Wolz

docker-platform's People

Contributors

alexanderwolz avatar

Stargazers

Dennis Lampert avatar  avatar

Watchers

 avatar

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.