Sign inSign up

warmos/contman

By warmos

Updated 4 months ago

A container management tool inspired by both Portainer and Tailon

Image
0

7.0K

warmos/contman repository overview

Contman

A container management tool inspired by both Portainer and Tailon

The development of Contman is in early stage!

Requirements

To make application function properly, it needs to have access to the host's docker.sock and overlay2 usually located in /var/lib/docker/ Please mount it into the container.

Label system

To display certain options for a specific container, you may need to specify some labels for each container, that you want to manage. There is unfinished list of labels and their explanation (note that every label starts with preferably com.contman.* or containerManagement.*, contman.*):

example: com.contman.log.dirName=/path/to/logfile

LabelExample valueFunction
logs.logName/path/to/logfile.logThis will show an option to read a custom log located in the container
logDirs.dirName/path/to/dir/This will show an option for all the files listed in the directory (non-recursive!)
links.linkNameURLThis will create a button while the container is opened in the application. The button text will be set to linkName and destination to URL
groupgroupNameSpecifies the name of group which can see, read and manipulate with container. Others won't see this container. Note that users of group "admin" sees all containers
controlstrue|falseEnables or disables control of container. Default is true. If controls are disabled, only logs and links are visible but user can't manipulate with container
noLinkstrue|falseEnables or disables link buttons. Default is false
forceShowLinkstrue|falseShow links even if there are no links.* defined. This will create button for all exposed ports. Note that no buttons will be shown if noLinks label is defined. Default false

NOTE: More labels will be coming soon

Remoting

Contman supports connecting to other instances of contman as long as you have correct credentials to the destination server. This will be configurable using environment variables in future updates. In latest version the easiest way is to mount hosts.json file to the container specifying remote instances. See Quick start section where we mount hosts.json

Quick start

docker-compose.yml

Use this quick start docker-compose.yml and tailor it to you needs:

services:
  contman:
    image: warmos/contman
    container_name: contman
    labels:
      - 'com.contman.logDirs.logs=/srv/http/sys/log'
    ports:
      - 5000:80
    volumes:
      - '/var/run/docker.sock:/var/run/docker.sock'
      - '/var/lib/docker/overlay2:/var/lib/docker/overlay2' #log and files reading
      - '/data/system/overlay2:/data/system/overlay2' #log and files reading
      - './hosts.json:/srv/http/sys/dat/hosts.json'
      - './logs:/srv/http/sys/log'
docker run

Here is a generalized command to run a container with labels specifying location URL of running application and exporting its logs to the Contman

docker run -d --name test \
	-e TESTENV=true \
	-p 8080:8080 \
	-p 4848:4848 \
	-p 9000:8888 \
	-l containerManagement.controls=true \
	-l containerManagement.group=admin \
	-l containerManagement.links.App=http://server.com:8080/appurl \
	-l containerManagement.links.Admin=http://server.com:4848/ \
	-l containerManagement.links.Console=http://server.com:9000/ \
	-l containerManagement.logDirs.logsServer=/var/log/httpd/ \
	-l containerManagement.logDirs.app=/srv/http/logs/ \
	someImage

hosts.json

Use this file and mount it into /srv/http/sys/dat/hosts.json to specify any other remote contman hosts, so you can manage them all from single URL! Example hosts.json:

[
	{
		"name": "Local",
		"desc": "Local Maya host",
		"default": true
	},
	{
		"name": "Remote",
		"host": "192.168.0.100",
		"desc": "A remote Maya host",
		"port": 8000,
		"user": "admin",
		"pass": "admin",
		"groups": ["*"]
	}
]

NOTE: groups directive specifies groups of users that will be able to use the host.

Techstack

Contman uses PHP with Apache (preferably) or Nginx (not implemented yet). OS of the container is Archlinux to ensure latest PHP without (at least known) vulnerabilities.

Support

If you need help making the Contman work contact me at [email protected]

Tag summary

Content type

Image

Digest

sha256:9ff2dcc27

Size

347.4 MB

Last updated

over 1 year ago

docker pull warmos/contman