Note: This project is currently not stable
Run docker containers as services.
- Extract tar file
- run
makepkg
- Intall via
sudo pacman -U arch-automated-docker-git.tar.gz
Program works by taking configuration from automated-docker.conf
and applying them to
[email protected]
in order to generate a [email protected]
.
automated-docker.conf
is used to store the command line parameters needed to launch the container.
Generally this is found in /etc/automated-docker/automated-docker.conf
.
Example Entry:
[arch]
-p 555:555
-v ~/stuff:/home/things
base/archlinux
Name of image is within brackets, each additional line should include only one arg value pair, with the last line being the base image.
In this example the image name is arch, has command line options -p 555:555 -v
and ~/stuff:/home/things
, and uses image base/archlinux
in the docker repositories.
Now that the conf file is setup, now it's time to modify the template file.
arch-automated-docker takes the .template files, adds the command line arguments and container name from
automated-docker.conf
, and generates a .service
file to be used with systemd. By default
automated-docker will create a [email protected]
file (usually in
/etc/automated-docker/
). When start-container reads automated-docker.conf
it will search for any
template files with the name [email protected]
, if that is not found
then it will use [email protected]
. Either way, the script will create a file named
[email protected]
and place it in the systemd service directory
(/etc/systemd/system/
by default). This can then be loaded on startup (sudo systemctl enable [email protected]
) and started (sudo systemctl start [email protected]
).
The default [email protected]
should be fine for most users. Note that the default
solution takes advantage of Ibukanov in the thread moby/moby#6791.
Simply issue start-container
to create service files for each container listed in
automated-docker.conf
.
This quick start was written using defaults and Arch Linux. It shows how to create a basic arch linux image that binds port 553 of the host.
- Install Using Directions above
- Add the following below the comments in
/etc/automated-docker/automated-docker.conf
[arch]
-p 553:553
base/archlinux
- [Optional] copy the default template file to a new one named
[email protected]
cp /etc/automated-docker/[email protected] /etc/automated-docker/[email protected]
- Run start-container
start-container
- Start and enable the service to run at bootup
sudo systemctl start [email protected] && sudo systemctl enable [email protected]