+ ds
- Docker Scripts
+
ds
COMMAND
DockerScripts is a shell script framework for Docker which
+ simplifies managing containers in a context. 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 current
+ directory.
init
src_dir, info
Initialize a working directory by getting the file settings.sh + from the given source directory. Show some of the current + settings.
build
, create
, config
Build the image, create the container, and configure the guest + system inside the container.
start
, stop
, restart
Start, stop and restart the container.
shell
Get a shell on the container.
exec
Execute a command inside the container.
snapshot
Make a snapshot of the container.
remove
Remove the container and the image.
help
Display a help message.
./settings.sh
It is located in directory of the container and keeps
+ the settings of the container and the application installed
+ inside it.
+
+
+The file $SRC/ds.sh
or ./ds.sh
can be used to redefine and
+customize some functions, without having to touch the code of the main
+script. Also, custom commands can be defined for each container by
+adding the file ./cmd/command.sh
, which contains the function
+cmd_command() { . . . }
.
user@laptop:~$ git clone https://github.com/docker-scripts/ds
+ user@laptop:~$ cd ds/
+ user@laptop:~$ sudo make install
+ user@laptop:~$ ds help
Some examples of using ds
are shown below.
user@laptop:~# git clone https://github.com/docker-scripts/moodle /usr/local/src/moodle
+ user@laptop:~# mkdir -p /var/containers/moodle1
+ user@laptop:~# cd /var/containers/moodle1/
+ user@laptop:~# ds init /usr/local/src/moodle
+ user@laptop:~# vim settings.sh
+ user@laptop:~# ds build
+ user@laptop:~# ds create
+ user@laptop:~# ds config
+ user@laptop:~# ds shell
Copyright (C) 2017 Dashamir Hoxha (dashohoxha@gmail.com). The + code is on GitHub at https://github.com/dashohoxha/ds.
+ +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/.
+ + +