1. ds(1)
  2. DockerScripts
  3. ds(1)

NAME

ds - Docker Scripts

SYNOPSIS

ds [-x] [@<container>] <command> [<arg>...]

DESCRIPTION

DockerScripts is a shell script framework for Docker.

Each container is like a virtual machine that has an application installed inside. Each container has a base directory where the settings of the container are stored (in the file settings.sh). The command ds picks the parameters that it needs from the file settings.sh in the container's directory.

Normally the commands are issued from inside the container's directory, however the option @<container> can be used to specify the context of the command.

The option -x can be used for debugging.

COMMANDS

FILES

~/.ds/

      The default ds config directory.

~/.ds/config.sh

      The configuration file.

~/.ds/ds.sh

      Optional customization file.

./settings.sh

      It is located in directory of the container and keeps the
      settings of the container and the settings of the
      application installed inside it.

ENVIRONMENT

DSDIR

      Overrides the default ds config directory (~/.ds/).

CUSTOMIZATION

The functions of DockerScripts can be redifined or customized without having to touch the code of the installed script. The framework does this by including optional customization scripts, if it finds them. These scripts are included (sourced) in this order:

A newly defined function will override a previously defined one. To reuse the previous function inside the new one (if this makes sense), we can rename it before the new function is defined, like this: rename_function fun1 orig_fun1.

Also, new commands can be defined for each application and for each container. The framework will look for a custom command named cmd_command in these places:

These files will be included (sourced) if they exist. If the name of a newly defined command is the same as an existing command, it will override the existing one. To reuse the previous command definition inside the definition of new one (if this makes sense), we can rename it before the new function is defined, like this: rename_function cmd_command1 orig_cmd_command1.

INSTALLATION

git clone https://gitlab.com/docker-scripts/ds /opt/docker-scripts/ds
cd /opt/docker-scripts/ds/
make install
ds
ds -h

EXAMPLES

Installing Web Server Proxy

ds pull wsproxy
ds init wsproxy @wsproxy
source ds cd @wsproxy   # (or: cd /var/ds/wsproxy/)
vim settings.sh
ds build
ds create
ds config

Installing Moodle

ds pull moodle
ds init moodle @moodle1

source ds cd @moodle1   # (or: cd /var/ds/moodle1/)
vim settings.sh
ds build
ds create
ds config

ds wsproxy add
ds wsproxy ssl-cert -t
ds wsproxy ssl-cert

Installing ShellInABox

ds pull shellinabox
ds init shellinabox @shell1

source ds cd @shell1
vim settings.sh
ds build
ds create
ds config

ds @wsproxy domains-add shell1-example-org shell1.example.org
ds @wsproxy get-ssl-cert user@example.org shell1.example.org --test
ds @wsproxy get-ssl-cert user@example.org shell1.example.org

Installing SchoolTool

ds pull schooltool
ds init schooltool @school1

source ds cd @school1
vim settings.sh
ds build
ds create
ds config

source ds cd @wsproxy
ds domains-add school1-example-org school1.example.org
ds get-ssl-cert user@example.org school1.example.org --test
ds get-ssl-cert user@example.org school1.example.org

AUTHOR

Copyright (C) 2017 Dashamir Hoxha (dashohoxha@gmail.com). The code is on GitLab at https://gitlab.com/docker-scripts/ds.

COPYLEFT

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

  1. dashohoxha
  2. August 2017
  3. ds(1)