,

How to Install docker-ai on Ubuntu 24.04

Supercharge Your Docker Workflow with docker-ai: An Interactive Command Companion

Tired of forgetting the exact syntax for a docker command? Wish you had a patient tutor to teach you Docker concepts offline? Meet docker-ai, a smart, interactive command-line tool designed to be your personal Docker assistant.docker-ai is a versatile shell that comes in two powerful modes:

  1. AI Mode: Translate plain English into precise Docker commands. It’s context-aware, meaning it knows which containers you have running to give you more accurate suggestions.
  2. Learning Mode: An offline, interactive encyclopedia of Docker knowledge, perfect for learning concepts without an internet connection.

This guide will walk you through installing and using docker-ai on Ubuntu 24.04 to streamline your development process.

GITHUB : https://github.com/Aj7Ay/docker-ai.git ( Star Repo )

Prerequisites :

  1. AWS Account
  2. One Ubuntu 24.04 server
  3. Groq API key

Step 1: Create Groq Free API key

NOTE : Free API key not supports All models

  1. Go to browser and search for groq.com
  2. Click on Hamburger

3. Click on Developers –> FREE API KEY

4. Login with Google

5. Once after login click on API keys

6. Create one API key

7. Save it Safe place

Step 2: Download the docker-ai Debian Package

First, we need to grab the latest release from the official GitHub repository.

  1. Find the latest release: Navigate to the docker-ai Releases Page.
  2. Copy the .deb link: Under the latest release, find the asset ending in _amd64.deb. Right-click on it and select “Copy Link Address”.

Now, open your Ubuntu terminal and use wget to download the file.

sudo apt update

wget https://github.com/Aj7Ay/docker-ai/releases/download/v0.2.5/docker-ai_v0.2.5_amd64.deb

Download Docker-ai

Step 3: Install the Package on Ubuntu 24.04

While you can sometimes use sudo apt install ./your-file.deb, a more robust and universally compatible method is to use dpkg (the Debian Package Manager) first, and then let apt fix any missing dependencies.

  1. Install with dpkg:

This command attempts to install the package. It might complain about missing dependencies, which is perfectly normal.

# Replace the filename if yours is different
sudo dpkg -i ./docker-ai_v0.2.5_amd64.deb     # update package to install

2. Fix Dependencies with apt:

This command is the magic step. It tells apt to find and install any libraries that docker-ai needs to run, completing the installation.bash

sudo apt-get install -f

After these two commands, docker-ai is fully installed and ready to go!

Step 4: A Practical Walkthrough

  1. Let’s Check Docker-ai
  2. Export Groq API key we created
export GROQ_API_KEY="sbcnsjsfjlkfldfkoldkfossjdfdof"

3. Use docker-ai in command line

docker-ai

Check docker installed or not using AI

Is docker installed on this server?

Use cmd + C to exit

Let’s how can we install docker-ai using same AI, We have learner AI to give commands

DOCKER_AI_MODE=learn docker-ai

And ask inside learn-ai

How to install docker?

It will provide some commands use them to install docker

Let’s Run commands

#!/bin/bash
# Uninstall old versions
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done

# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install -y ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

# Install the latest version
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Let’s add Ubuntu to docker group

sudo usermod -aG docker ubuntu
newgrp docker

Step 5: Test Docker-ai

Let’s test docker Ai with some commands

docker-ai
# ask questions

Is docker installed on this server?

what is docker version?

Let’s run simple nginx container

run docker container with nginx image on port 80:80

check running containers?

Let’s check logs and stop container

check docker logs?

stop the running containers.

Finally clenaup system resources

cleanup system resources

Why docker-ai Belongs in Your Toolkit

docker-ai isn’t just another tool; it’s a companion that grows with you.

  • For Beginners: It flattens the steep learning curve of Docker by providing instant answers and a structured learning path.
  • For Experts: It acts as a “second brain,” saving you the mental energy of recalling obscure commands or flags, letting you focus on the bigger picture.
  • For Everyone: It’s a fast, efficient, and fun way to interact with Docker.

Conclusion

You’ve successfully installed docker-ai and learned how to use its powerful AI and Learning modes. It’s a testament to how modern tools can simplify complex technologies.Head over to the GitHub repository to star the project, contribute, or give feedback. Download it today and change the way you work with Docker

mrcloudbook.com avatar

Ajay Kumar Yegireddi is a DevSecOps Engineer and System Administrator, with a passion for sharing real-world DevSecOps projects and tasks. Mr. Cloud Book, provides hands-on tutorials and practical insights to help others master DevSecOps tools and workflows. Content is designed to bridge the gap between development, security, and operations, making complex concepts easy to understand for both beginners and professionals.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *