An easy-to-use Discord bot to manage your Docker containers.
Command | Description |
---|---|
!help |
Show all available commands |
!ping |
Check if the bot is online |
!dockerps |
List all running Docker containers |
!dockerstop <container> |
Stop a Docker container |
!dockerstart <container> |
Start a Docker container |
!dockerrestart <container> |
Restart a Docker container |
!dockerremove <container> |
Remove a Docker container |
!dockershow <container> |
Show information about a Docker container |
!dockercreate <image>:<tag>/<image> <name> <ports (80:80,81:81)> |
Create a new Docker container |
!dockerinfo |
Show information about the Docker host |
!dockerimages |
List all existing images |
!dockerpull <image>:<tag>/<image> |
Pull an image |
!dockerremoveimage <image> |
Remove an image |
- Create a new Discord bot at the Discord Developer Portal
- Copy the bot token
- Invite the bot to your server using the following link:
https://discord.com/oauth2/authorize?client_id=YOUR_BOT_ID&permissions=8&scope=bot
Run the following command to start the Docker container:
docker run \
-d \
--name docker-discord-bot \
-u root \
-e ApplicationSettings__DiscordToken=YOUR_DISCORD_BOT_TOKEN \
-v /var/run/docker.sock:/var/run/docker.sock \
alexdev28/docker-discord-bot:latest
Or with docker compose:
version: '3.8'
services:
docker-discord-bot:
image: alexdev28/docker-discord-bot:latest
container_name: docker-discord-bot
restart: unless-stopped
user: root
environment:
- ApplicationSettings__DiscordToken=YOUR_DISCORD_BOT_TOKEN
volumes:
- /var/run/docker.sock:/var/run/docker.sock
The bot can be configured using environment variables:
Environment Variable | Description | Default Value | Required |
---|---|---|---|
ApplicationSettings__DiscordToken |
Discord bot token | null |
✅ |
ApplicationSettings__AdminUser |
Discord admin username | null |
❌ |
ApplicationSettings__CommandPrefix |
Command prefix | ! |
❌ |
ApplicationSettings__DockerRegistryUrl |
Private registry url | null |
❌ |
ApplicationSettings__DockerRegistryUsername |
Private registry username | null |
❌ |
ApplicationSettings__DockerRegistryPassword |
Private registry password | null |
❌ |
© Alexander Konietzko 2024
Released under the MIT license