HashiQube - DevOps Lab
Youtube Channel Medium Posts Riaan Nolan Linkedin Riaan Nolan Hashicorp Ambassador

.

Portainer

Making Docker management easy with a powerful container management interface

Portainer Logo

🚀 Introduction

In this HashiQube DevOps lab, you will get hands-on experience with Portainer. Portainer provides an intuitive UI that simplifies Docker container management, allowing you to build and manage your Docker environments with ease.

Portainer Dashboard

🛠️ Provision

Choose one of the following methods to set up your environment:

Open in GitHub Codespaces

bash docker/docker.sh
bash portainer/portainer.sh
vagrant up --provision-with basetools,docker,docsify,portainer
docker compose exec hashiqube /bin/bash
bash hashiqube/basetools.sh
bash docker/docker.sh
bash portainer/portainer.sh

🖥️ Using Portainer

After provisioning, you can access the Portainer interface by opening your browser and navigating to:

http://localhost:9333

💡 If you're accessing Portainer for the first time, you'll need to create an admin account and set up your initial endpoint.

⚙️ Portainer Provisioner

The portainer.sh script handles the installation and configuration of Portainer:

[filename](portainer.sh ':include :type=code')

🔍 Key Features

  • Simple management interface for Docker containers
  • Dashboard overview of your container environment
  • Container creation with an easy-to-use wizard
  • Volume management for persistent storage
  • Network configuration for container connectivity
  • Template library for quick deployments
  • Role-based access control for team environments
  • Container logs and console access for troubleshooting

📚 Resources

#!/bin/bash
# https://www.portainer.io/
sudo docker stop portainer
sudo docker rm portainer
yes | sudo docker system prune -a
yes | sudo docker system prune --volumes
sudo docker volume create portainer_data
sudo docker run \
  --name portainer \
  -p 0.0.0.0:8333:8000 \
  -p 0.0.0.0:9333:9000 \
  -v portainer_data:/data \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -d portainer/portainer
echo -e '\e[38;5;198m'"++++ Portainer: http://localhost:9333"