An open API service indexing awesome lists of open source software.

https://github.com/davidecavestro/dwservice-agent-docker

A way to containerize dwservice
https://github.com/davidecavestro/dwservice-agent-docker

docker docker-compose dwservice remote-control remote-shell

Last synced: 29 days ago
JSON representation

A way to containerize dwservice

Awesome Lists containing this project

README

          

= dwservice-agent-docker - A way to containerize dwservice

== What's this?

This repo provides some config and a script to package the dwservice agent
into a docker image and run it.

== How to use it?

Create a new agent from https://github.com/dwservice/agent[dwservice] UI
and take note of the agent code.

Copy the `.env.example` file into `.env`, updating the _AGENT_CODE_ variable
and adding the packages you need into the container.

Adapt the `docker-compose.yml` entries as per your needs
(i.e. use `privileged: true`, `network_mode: "host"`, set a `restart_policy`).

Finally run `docker-compose build && docker-compose up`.

== How does it work?

* the config folder is mounted into the container at `/config` path
* the entrypoint.sh script looks for a file named `/config/config.json`
* if doesn't exist or is not valid, the entrypoint launches the config
generation routine passing the agent code obtained from the
_AGENT_CODE_ environment variable
* the entrypoint creates at `/app/core/config.json` a symlink pointing
to `/config/config.json`
* the entrypoint launches the agent

=== Container side

Relevant files as seen within the container

```
/
├── config
│ └── config.json # 2. config file generated by dwservice
└── app
├── core
│ ├── agent.py # 4. agent launch routine
│ ├── config.json -> /config/config.json # 3. link to config file
│ └── ...
├── make
│ ├── create_config.py # 1. config generation routine
│ └── ...
└── ...
```

=== Host side

Relevant files as seen from the host

```
.
├── config
│  └── config.json # config file generated by dwservice
├── .env # your config
├── docker-compose.yml
├── Dockerfile
├── entrypoint.sh
└── ...

```

== License

This software is released under the MIT License.

All trademarks and product names are the property of their respective owners.