Cockpit: Dockerized Cockpit?

Created on 29 Oct 2018  路  4Comments  路  Source: cockpit-project/cockpit

I've skimmed through the majority of the open and closed issues and i actually found very few clues of some people running it using docker and atomic, but what i want to ask is different.

is there a way (at least a guide) to install cockpit on a container and "that" container would monitor external servers just like it's supposed to work but from inside a docker container, why?
because let's say i have +50 servers, currently i'm using cockpit to monitor 20, but when i try to add another servers i see a message saying that the max established connections allowed are 20.
I have a large server and I want to run separate cockpit instances on it. (ofcourse on different ports)
so that i can reverse proxy them under nginx, and each one would have it's own domain name:

xx.example.com
yy.example.com

both pointing to the same server but different ports of different cockpit instances (data)

edit: i've tried to use ubuntu image (from docker hub) and created a Dockerfile as well as a docker-compose file with all the needed steps to get cockpit work, but it's not exposing the traffic to the host server, rather it says connection refused that's because cockpit (although it's installed correctly inside docker) it's not mapping itself to any port.

Most helpful comment

As you already found out, the cockpit/ws container isn't suitable for that. It only containerizes the web server, but that (privileged) container talks to and manages its host. This includes the list of remote systems, so running more than one ws container on the same machine doesn't make sense -- and it surely doesn't "multiply" the available number of remote servers.

The way cockpit is designed, it really wants/needs to run on a full machine, not a single-task docker application container. So you might be much more successful with running a bunch of LXC (or LXD, if you run Ubuntu -- this is really so much nicer!) system containers. We don't test cockpit in system containers, but there is no reason why it shouldn't work (if you find bugs, please tell us).

The other approach which might work for you is to not use the Dashboard (which is the thing that limits to 20 remotes, as it keeps a connection open to all of them), but use your (single) cockpit/ws docker instance as a bastion host through the "Connect to:" option on the login page, or a direct URL login like https://machine.with.cockpit.ws:9090/=remote.machine.with.ssh . But this is of course not really "monitoring" them, just the possibility to get a Cockpit session to a chosen machine, one at a time.

All 4 comments

As you already found out, the cockpit/ws container isn't suitable for that. It only containerizes the web server, but that (privileged) container talks to and manages its host. This includes the list of remote systems, so running more than one ws container on the same machine doesn't make sense -- and it surely doesn't "multiply" the available number of remote servers.

The way cockpit is designed, it really wants/needs to run on a full machine, not a single-task docker application container. So you might be much more successful with running a bunch of LXC (or LXD, if you run Ubuntu -- this is really so much nicer!) system containers. We don't test cockpit in system containers, but there is no reason why it shouldn't work (if you find bugs, please tell us).

The other approach which might work for you is to not use the Dashboard (which is the thing that limits to 20 remotes, as it keeps a connection open to all of them), but use your (single) cockpit/ws docker instance as a bastion host through the "Connect to:" option on the login page, or a direct URL login like https://machine.with.cockpit.ws:9090/=remote.machine.with.ssh . But this is of course not really "monitoring" them, just the possibility to get a Cockpit session to a chosen machine, one at a time.

Bump.

is it still the case with the web version that allowed only up to 20 remotes?
say I went the bastion way, how can i add more servers? more than 20, config files?
Please advise.

It seems they are very strict with this 20 remotes limit. They just closed an issue asking to increase that and stated that it's not in their plans.
I have the same issue you do. And thought the same solution you did.
Tried with containers but cockpit won't start inside the container as it is not bootstrapped by systemd.
Probably using virtual machines with vagrant would do the job for now. It's far from ideal...
I have no experience with LXC.

Update, vagrant worked as desired.

Here is a Docker image I created to develop Cockpit packages: https://hub.docker.com/r/markdegroot/cockpit-ubuntu. Maybe it can be used to connect to other hosts as well. You'll probably have to install SSH and some other packages. I did not try this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

FireDrunk picture FireDrunk  路  6Comments

cedroid09 picture cedroid09  路  5Comments

tmjpugh picture tmjpugh  路  8Comments

garrett picture garrett  路  4Comments

bachradsusi picture bachradsusi  路  4Comments