How to Add a New Development Environment to Portainer

0
551
How to Add a New Development Environment to Portainer


If you have deployed Portainer as a Kubernetes improvement platform and need to add a special surroundings, you are in luck — the method is kind of easy.

Smiling indian business man working on laptop at home office. Young indian student or remote teacher using computer remote studying, virtual training, watching online education webinar at home office.
portainer-add-development-environment

Recently, I outlined methods to deploy Portainer to a MicroK8s Kubernetes cluster. The course of is surprisingly simple and goes an extended method to strip the problems from Kubernetes. That Kubernetes surroundings makes for a sturdy improvement course of, however what in the event you additionally must work with Docker? Thankfully, Portainer has many handy Docker options that make deploying these containers a breeze.

SEE: Hiring package: Back-end Developer (TechRepublic Premium)

With Portainer, you possibly can add as many environments as you want to develop for Kubernetes or Docker inside the identical web-based GUI. In this tutorial, I’ll present you methods to add a Docker surroundings to the identical Portainer occasion that was deployed utilizing MicroK8s.

Jump to:

What you’ll want so as to add a Docker surroundings to Portainer

The solely stuff you’ll want for this course of are a working occasion of Portainer and a consumer with sudo privileges. I’ll reveal this on the Ubuntu Server 22.04 working system. If your OS differs, you’ll want to change the steps for putting in Docker and Docker Compose.

How to put in Docker and Docker Compose

To start, we should add the official Docker repository. We’ll first add the GPG key with this command:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Next, add the Docker repository:

echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) secure" | sudo tee /and many others/apt/sources.record.d/docker.record > /dev/null

From right here, you’ll want to put in the mandatory dependencies with this command:

sudo apt-get set up apt-transport-https ca-certificates curl gnupg lsb-release git -y

Install newest Docker Engine

Now, we will set up the most recent model of Docker Engine:

sudo apt-get replace
sudo apt-get set up docker-ce docker-ce-cli containerd.io -y

Next, you’ll add your consumer to the docker group with this command:

sudo usermod -aG docker $USER

To end out this part, sign off and log again in for the modifications to take impact.

Install Docker Compose

Finally, we’ll set up Docker Compose with this command:

sudo apt-get set up docker-compose -y

With Docker put in, you’re prepared so as to add the brand new surroundings.

How so as to add the Docker surroundings to Portainer

Now, you’re prepared so as to add the Docker surroundings to Portainer. To start, log in to your Portainer occasion and click on Environments below Settings (Figure A).

Figure A

The Portainer left navigation comprises entry to Environments.

In the ensuing window (Figure B), choose Docker Standalone and click on Start Wizard.

Figure B

There are a couple of forms of environments you possibly can add to Portainer.

In the ensuing window (Figure C), choose Agent to disclose the Docker command it’s essential to run on the internet hosting server so as to add the Portainer agent.

Figure C

We’re including the Docker surroundings by means of an agent.

The command to do that is:

docker run -d -p 9001:9001 --name portainer_agent --restart=at all times -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/volumes:/var/lib/docker/volumes portainer/agent:2.16.2

Once you’ve run that command, give the surroundings a Name and an Environment Address, after which click on Connect. The Environment Address can be within the type of SERVER:9001, the place SERVER is the IP deal with of the internet hosting server.

The connection ought to be made in a short time. If you then click on Home within the upper-left nook, you’ll see your new Docker surroundings is able to use (Figure D).

Figure D

Our Docker surroundings has been added and is prepared to be used.

Simplify your container improvement course of

If you’re a platform engineer, developer or different consumer who’s seeking to simplify your container improvement course of, I like to recommend utilizing Portainer for Kubernetes and Docker. This net GUI has the whole lot you want to not solely excellent your container deployments however handle them as effectively.

Read subsequent: The 12 finest IDEs for programming (TechRepublic)

LEAVE A REPLY

Please enter your comment!
Please enter your name here