If you have actually deployed Portainer as a Kubernetes advancement platform and want to add a various environment, you remain in luck– the procedure is rather simple.
portainer-add-development-environment Just recently, I detailed how to release Portainer to a MicroK8s Kubernetes cluster. The procedure is remarkably easy and goes a long way to remove the problems from Kubernetes. That Kubernetes environment makes for a robust advancement procedure, however what if you also require to deal with Docker? Luckily, Portainer has lots of hassle-free Docker functions that make deploying those containers a breeze.
SEE: Hiring package: Back-end Developer (TechRepublic Premium)
With Portainer, you can add as many environments as you require to establish for Kubernetes or Docker within the same web-based GUI. In this tutorial, I’ll reveal you how to add a Docker environment to the exact same Portainer instance that was released utilizing MicroK8s.
What you’ll need to include a Docker environment to Portainer
The only things you’ll need for this process are a running instance of Portainer and a user with sudo opportunities. I’ll demonstrate this on the Ubuntu Server 22.04 os. If your OS differs, you’ll require to modify the actions for setting up Docker and Docker Compose.
How to install Docker and Docker Compose
Finest service software application
To start, we should add the main Docker repository. We’ll initially add the GPG secret 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) steady”|sudo tee/ etc/apt/sources. list.d/ docker.list >/ dev/null
From here, you’ll need to set up the essential dependencies with this command:
sudo apt-get set up apt-transport-https ca-certificates curl gnupg lsb-release git -y
Install most current Docker Engine
Now, we can set up the latest version of Docker Engine:
sudo apt-get upgrade
sudo apt-get set up docker-ce docker-ce-cli containerd.io -y
Next, you’ll include your user to the docker group with this command:
sudo usermod -aG docker $USER
To finish out this area, log out and log back in for the modifications to take effect.
Install Docker Make Up
Lastly, we’ll install Docker Make up with this command:
sudo apt-get set up docker-compose -y
With Docker installed, you’re all set to include the new environment.
How to add the Docker environment to Portainer
Now, you’re prepared to add the Docker environment to Portainer. To begin, log in to your Portainer instance and click Environments under Settings (Figure A).
The Portainer left navigation consists of access to Environments.
In the resulting window (Figure B), select Docker Standalone and click Start Wizard.
There are a few types of environments you can add to Portainer. In the resulting window (Figure C), choose Representative to expose the Docker command you need to run on the hosting server to include the Portainer agent.
We’re adding the Docker
environment by method of a representative.
The command to do this is: docker run-d -p 9001:9001– name portainer_agent– restart=always -v/ var/run/docker. sock:/ var/run/docker. sock -v/ var/lib/docker/ volumes:/ var/lib/docker/ volumes portainer/agent:2.16.2
When you’ve run that command, give the environment a Name and an Environment Address, and after that click Connect. The Environment Address will be in the kind of SERVER:9001, where SERVER is the IP address of the hosting server.
The connection must be made very quickly. If you then click House in the upper-left corner, you’ll see your brand-new Docker environment is prepared to use (Figure D).
Our Docker environment has been included and is ready for use.
Streamline your container advancement process
If you’re a platform engineer, developer or other user who is aiming to simplify your container advancement process, I suggest using Portainer for Kubernetes and Docker. This web GUI has whatever you require to not only best your container implementations however handle them as well.
Check out next: The 12 finest IDEs for programs (TechRepublic)