Can I Install Docker Over cPanel? - docker

Can I install Docker over a server with pre-installed cPanel and CentOS 7? Since I am not aware of Docker, I am not completely sure whether it will mess with cPanel or not. I already have a server with CentOS 7 and cPanel configured. I want to know if I can install Docker over this configuration I mentioned without messing up?

Yes you can install docker over cPanel/WHM just like installing it on any other CentOS server/virtual machine.
Just follow these simple steps (as root):
1) yum install -y yum-utils device-mapper-persistent-data lvm2 (these should be already installed...)
2) yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
3) yum install docker-ce
4) enable docker at boot (systemctl enable docker)
5) start docker service (systemctl start docker)
The guide above is for CentOS 7.x. Don't expect to find any references or options related to Docker in the WHM interface. You will be able to control docker via command line from a SSH shell.
I have some docker containers already running on my cPanel/WHM server and I have no issues with them. I basically use them for caching, proxying and other similar stuff.
And as long as you follow these instructions, you won't mess-up any of your cPanel/WHM services/settings or current cPanel accounts/settings/sites/emails etc.
Not sure why you haven't tried this already!

I've been doing research and working on getting Docker working on cPanel. It's not just getting it to work on a CentOS 7 box but rather making it palatable for the cPanel crowd in the form of a plugin. So far I can confirm that it's absolutely doable. Here's what I've accomplished and how:
Integrate Docker Compose with cPanel (which is somewhat a step
further from WHM)
Leverage the user-namespace kernel feature in Linux so Docker
services can't escalate their privileges (see userns remap)
Leverage Docker Compose so users can build complex services and
start ready apps from the store with a click
Make sure services starting via Docker run on a non-public IP on the
server. Everything gets routed via ProxyPass
cPanel has been gracious to provide a Slack channel for people to discuss this upcoming plugin. I'd be more than happy to invite you if you'd like to be kept updated or to contribute. Let me know!
FYI, there's more info here on https://www.unixy.net/docker if you're interested. Please note that this plugin is in private beta but more than happy to let people use it!

Yes you could, in fact someone else has done it already: https://github.com/mirhosting/cPanel-docker

Related

ERROR: Couldn't connect to Docker daemon at http://0.0.0.0:2375 - is it running?

I am watching a course on Hyperledger Composer development online. I installed all the required prerequisites, docker, docker-compose, nodejs, golang. After cloning the fabric-samples repository from github. There is a file called byfn.sh inside a folder called first-network. On running the command ./byfn.sh up, it's giving the following error:
If, someone has experience working on it, please help. Any help would be appreciated. Thank you.
I think the first thing you should do is stop looking at or trying to use Hyperledger Composer. It is end of life now and some of it's components will have problems even if you install the exact required versions (for example the rest server fails to launch now on node 8 but changing to a newer version of node may break other parts of Composer).
As you had planned to use it with hyperledger fabric I would suggest that you just invest your time in Hyperledger fabric, see https://hyperledger-fabric.readthedocs.io/en/latest/
Regarding your problem with docker, I suspect you tried to install docker through the apt command in your wsl window ? I'm guessing that you are using WSL2, but if you are using WSL1 then docker will never work in a WSL1 environment. If it was WSL2 then the docker daemon doesn't automatically start in that environment you need to start it yourself first. I think the command is service docker start. The important thing here is to make sure you are using WSL2 and not WSL1 (see hyperledger fabric link later which provides guidance on making sure you are using WSL2).
An alternative to installing docker into WSL2 directly would be to install Docker Desktop for Windows and follow the hyperledger fabric instructions here https://hyperledger-fabric.readthedocs.io/en/latest/prereqs.html#wsl2

Docker for Windows installed WSL2 without apt

I'm trying to work on a project, and the setup steps begin like this:
Clone the repo
Set up Docker
Run make
Being a Windows user, I installed Docker for Windows, and it installed WSL2 to get all the Linux stuff set up. But when I went to run make from the WSL shell, it couldn't find it. So I tried to get make from apt-get... and that wasn't there either!
It would appear that my WSL2 install is broken. Unfortunately, Googling for it hasn't turned up much of use. So how do I obtain apt for WSL so that I can build my toolchain?
Something similar happened to me: I installed Docker Desktop in Windows some months ago and it configured WSL to run behind it. However, it was WSL version 1 instead of version 2, and it did not install any Linux distro, since both apps run on top of WSL.
So please, go through the tutorial on the manual installation of WSL to check if all the steps are actually configured.
Before that, you can already check what version of WSL you have installed and its state, by running, in CMD or PowerShell:
wsl -l -v
After you set WSL v2 as your default version (Step 5 of the tutorial), you can make sure that Docker Desktop uses it. For that, check this link on the Docker Desktop WSL 2 backend, more specifically the Install section.
Regarding the make part of your setup, I believe that you can do that in a system of your preference. If you want to do that on WSL, I recommend you install Ubuntu running over your WSL (Step 6 of the tutorial).
Once you installed Ubuntu or other distro, you can run it as any other app. There, you can manage your apt, make and other installations right as in Linux :)

Does a RHEL7 docker container need subscription?

I have a rhel7 host with docker in it.
I have build a image with also rhel7 as base image.
But when I run the container & do yum update or try to install in package with yum, it gives me below error.
"This system is not registered to Red Hat Subscription.you can use subscription manager to register"
I have already subscribed the host RHEL Machine. Do I need to subscribe each and every container with rhel image?
Or
Do I need to subscribe in the dockerfile itself while building the image?
Thanks
On the Docker hub, you can find some Red Hat docker images , like
https://hub.docker.com/r/richxsl/rhel6.5/
or
https://hub.docker.com/r/lionelman45/rhel7/
but in order to update them, you will need a valid subscription
You will find Red Hat docker images on the Red Hat site, at
https://access.redhat.com/containers
this article summarizes what you need in order to build a Red hat docker image
http://cloudgeekz.com/625/howto-create-a-docker-image-for-rhel.html
it begins with
Pre-requisites
Access to RHEL package repository.
With RHEL 8 Red Hat now offers a universal base image for docker containers which does not require a subscription.
The RHEL 7 documentation covers this. Please use your subscription to read section 1.4.
Paraphrasing what the documentation says:
You must use a subscribed RHEL 7 host to build containers
Containers based on RHEL 7 will use the host's subscription automatically and be able to access the RHEL 7 yum repositories
If you are trying to build RHEL 7 based containers on a properly subscribed RHEL 7 host and it doesn't work, you might be running into a bug. I would contact support to try and sort this out.
I used podman to pull RHEL 7 Universal Base Image, like this:
podman pull registry.access.redhat.com/ubi7/ubi
After that, although I still saw the warning message:
This system is not registered with an entitlement server. You can use subscription-manager to register.
but there was no issue to use yum for package installation or update.
You can also use RHEL8 ubi in the same approach without any issue.
I found this article that clarifies the RHEL UBI images which do not need a subscription.
https://developers.redhat.com/blog/2020/03/24/red-hat-universal-base-images-for-docker-users/
docker search registry.access.redhat.com/ubi
docker run -it --name test registry.access.redhat.com/ubi8/ubi:8.1 bash
I tried yum to install a netcat command which worked seamlessly
The RHEL UBI image contains 3 default repos (see yum repolist). Subscription is required for the CodeReady repo (ubi-8-codeready-builder).
If you decide to NOT subscribe then you can hide those warnings with:
yum --disableplugin=subscription-manager install <package>
Source:
https://developers.redhat.com/blog/2020/03/24/red-hat-universal-base-images-for-docker-users/

How to install docker-engine using docker binary without internet connection

I have downloaded docker binary version 1.8.2 and copied that to my backup server (centos server) which doesn't have internet connectivity. I have marked this as executable and started the docker daemon as mentioned in [https://docs.docker.com/engine/installation/binaries/][1]. But it doesn't seem to get installed as a docker service. For all the commands, I have to execute as sudo ./docker-1.8.2 {command}. Is there a way to install docker-engine as a service? Currently sudo docker version shows command not found. I'm a newbie to docker setup. Please advise.
Why not download the rpm package (there are also centos 6 packages), copy to USB stick and then to your server and simply install it with rpm command and that's it. That way you'd get the same installation as if you were to run yum.
Of course you may have some dependencies missing, but you could download all of these as well.
Firstly, if you're downloading bare binaries on an enterprise linux, you're probably doing things in a very bad way. Immediately, you're breaking updates and consistency, and leaving your system in a risky, messy state.
Try using yumdownloader --resolve to get the docker installable and anything it needs.
A better option may be to mirror the installation artifacts, and grab it from the local mirror, but that's beyond the scope if you don't do this already.

Install Ambari based on docker on multiple hosts

I have three servers and I want to set up Ambari. Unfortunately I have CentOS7 which currently isn't supported by Ambari. So I decided to use docker to overcome the OS dependency. I have found various docker-based Ambari version like this and this. The second one seems to be really good and easy to install on one host creating a pseudo-cluster, but I failed to install it on different hosts. I followed the described steps one by one trying to adjust them to the fact that I am not one the same host but when I try to assign a new host I get an error that the hostname is not valid.
For the first solution on the other hand, I can't understand the following. How can I make the containers on each host be aware of each other? Because Ambari needs every host to can ssh each other without password.
Excuse me in advance for my lack of expertise in this domain. Any comment would be very useful.
Ambari 2.2+ can be installed successfully and works fine on CentOS 7. Then you can install HDP 2.0+.
The links in your question try to install 1.6 and 1.7.

Resources