Skip to content

Docker

Docker is a container management platform, which can quickly and easily deploy and manage applications.

aaPanel provides One-Click rapid APP deployment function based on docker container

Docker menu:

One-Click InstallOverviewContainerCloud imageLocal image
ComposeNetworkVolumeRepositorySettings

One-Click Install

aaPanel provides one-click rapid APP deployment function based on docker container

alt text

  • Install : One-Click Install APP

    Different one-click installation apps have different requirements, please refer to the display.

    1. Using Wiki.js as an example:

    alt text

    FunctionExampleDescribe
    Namewiki_js_eD8eThe name of the one-click installed app
    Version selection
    latestSelect the image version
    Domain190.ccDomain name, used to proxy the port mapped by this container in Website --> Proxy
    Allow external access
    Deselect / OptionDeselect uses 127.0.0.1:3000 listen port, which requires configuring reverse proxy for access; otherwise, it uses the 0.0.0.0:3000 listen port
    Port3000The port mapped to the host cannot be an already used port
    Database nametcCkWbhcYJhaRjhxThe database name
    Database userjZFHyDECmKaN4ph6The database user
    Database passwordLmHZn3d6p4haJysMThe database password
    Cpu core limit00 no limit; Max cannot exceed the number of physical CPU cores
    Memory limit00 no limit; Max cannot exceed the physical memory
    Database servicesmysql_xj4fSelect the MySQL container name
    1. Complete deployment: alt text
  • Update app list : Update One-Click Install APP list

Installed

Show installed one-click installation

alt text

  • Backup

Display the backup list and back up the persistent data of the one-click install container

alt text

  1. Click to backup : Click to backup now

  2. Upload backup : Upload backup file

  3. Restore : Restore backup

  4. Download : Download backup

  5. Delete : Delete backup


  • Stop / Restart : Stop and restart this container

  • Details : Check the details of one-click installation of APP alt text

  • Rebuild :Rebuild this container. Please back up data before operation.

  • Uninstall : Uninstall this container. Please back up data before operation to avoid data loss.

  • Open logalt text

    1. Run logs: View the container running log
    2. Install logs: View the installation log of this APP
  • Enter installation directory

Enter the container data directory for one-click install APP

alt text


Overview

Check the resource usage of the server and the resource usage of the container.

alt text


Container

View the status of the container, start, stop, restart, delete, etc.

alt text

FunctionExampleDescribe
Create ContainerClick view ExampleCreate container from image, form Compose
Log ManageClick view ExampleView and manage container logs
Clear ContainerClear the container. Do not delete the container while it is in use. Make sure to back up before clearing to avoid data loss.
Container name / Manage
Click view ExampleContainer name, click to manage the container
Container IDafeb6.....24406d124Container ID, which is the unique identifier of the container
StatusRunningContainer status, click to Stop, Start, Restart, Kill, Pause
Imagenextcloud:latestImage used by the container:version
IP172.19.0.3Container’s IPv4
Port (Host-->Container)
8001 --> 80/tcpThe port mapped from the host to the container. Note: The network is port that will not be displayed in host mode
Create time2024-12-11 17:18:38Container creation time
NoteContainer remarks
TerminalClick view ExampleEnter the container terminal
DeleteDelete the container. Make sure to back up before deleting to avoid data loss.
MoreClick to use more functions
RenameClick view ExampleRename container
PathClick view ExampleClick to useFilesEnter the container's directory

Log Manage

Container --> Log Manage

Container --> More --> Log

alt text

  • Log cut : To turn on or off log cutting, clickEdit ConfigModify cutting time.

  • Refresh : Refresh the log of the current container

  • Download : Download the logs of the current container

  • Clear : Clear container logs

  • All : Display all logs of this container

  • Last 7 days : Display the logs of the last 7 days

  • Last 30 days : Display the logs of the last 30 days

  • Custom Time : Display logs at specified time

Clear Container

Container --> Clear Container

  • Clear stops unused containers. Please back up data before operation to avoid data loss.

Container name / Manage

Container --> Container name

Container --> Manage

  • Container statusalt text
FunctionExampleDescribe
Current Status:RunningStart, Stopped, Restart Container
Container name/mysql_4rjw-mysql_4rJW-1The name of this container
Container ID1d3c2....7090f4f7The ID of this container
Image usedsha256:c757d623....8dfcc1bThis container uses the image ID
Running timeLess than 1 hourThe running time of this container
Creation time2024-12-08 22:16:39The creation time of this container
Startup time2024-12-12 10:14:32The startup time of this container
Ports13306 --> 3306/tcpPorts of host and container Host --> Container
IP172.18.0.5IPv4 for this container
IPv6fd02:c0a8:10:0:0:0:0:1IPv6 for this container

  • Container terminal

alt text

  1. Please select Shell : Select terminal type: bash, sh

  2. Execute with Root Privileges : Log in to the container and use the root user


  • Container details
  1. View Displayalt text

    • View Container details

  1. File Displayalt text

    • Display the inspect information of the container, that is: docker inspect mysql_4rjw-mysql_4rJW-1

  1. Storage volumes

Show container storage volumes

alt text

  • Volume : Host directory/file
  • Container path : Directory/file of the container

  1. Container network alt text

    • View, join, and exit the container's network

  1. Reboot strategy alt text
    • No reboot : Restart the server/restart the Docker service does not start the container

    • Reboot after failure (default reboot 5 times) : The container will restart when an error occurs, and it will not restart after more than 5 times. Please check the container log to troubleshoot errors

    • Reboot on abnormal exit only : The container will restart when an error occurs

    • Reboot right after stopping : The container will restart after stopping


  1. Create image

    • Simple mode

      Save the container as a local image in Local image, example:

      Image name: my-mysql

      Version (tag) : 9.0.1

    alt text

    • Advanced mode

    alt text

    Save the container as a local image, save it in Local image and export the file


  1. Rename

alt text - Rename this container


  1. Real-time logsalt text
    • View and manage container logs

  1. Proxy

Use Website --> Proxy to proxy the port mapped by this container

The container needs to have corresponding ports mapped to the host

Only supported when the WEB service is Nginx

alt text

Terminal

alt text

  • Select Shell to confirm and proceed to the terminal of the container. alt text

Rename

Container --> More --> Rename

alt text

  • Rename container name

Path

Container --> More --> Path

  • useFilesEnter the container directory

alt text


Cloud image

Check out the official image on Docker Hub.

alt text

  • Image name : Image name is php

  • Star : The number of Image collections is 7467

  • Source : Image source Official (Docker Hub)

  • Description : Image description

  • Create Container : Create container from image, form Compose

  • Update : Image update, if there is an old one locally, will be prompted

  • Delete : Delete the image. Do not delete the container when it is in use.

  • Pull : Download the image from Docker Hub. If the download does not take a long time, try modifying the acceleration source in the settings.

Create Container

Container --> Create Container

Cloud image --> Create Container

Local image --> Create Container

  • Manual create

alt text

  1. Container name : Enter container name

  2. Image : Select container image

  3. Port:

    • Expose port: Map the port specified by the container to the port specified by the host
    • Expose all: Map all ports of the container to the corresponding ports of the host
  4. Reboot Rule

    • No reboot : Restart the server/restart the Docker service does not start the container
    • Reboot after failure (default reboot 5 times) : The container will restart when an error occurs, and it will not restart after more than 5 times. Please check the container log to troubleshoot errors
    • Reboot on abnormal exit only : The container will restart when an error occurs
    • Reboot right after stopping : The container will restart after stopping
  5. Network : Select the network mode of the container. The default is bridge.

  6. Mount/Map : Mount the container directory to the host, or specify a Volume

  7. Command : Set the command to be executed after the container is started. can be empty

  8. Entrypoint : Set the main command of the container. The command that is always executed when starting, defines how the container runs, can be empty

  9. Automatic deletion of containers after exit : Automatically delete the container after it is stopped

  10. Console Interaction:

    • Pseudo-TTY (-t) : Allocate a pseudo-TTY
    • Standard input (-i) : Keep STDIN open even if not attached
    • Privilege Mode : Whether the container is running in privileged mode
  11. Min memory : Set the Min allocated memory of the container, which cannot exceed the physical memory.

  12. CPU limit : Set the Max number of CPU cores used by the container, which cannot exceed the number of physical cores.

  13. Memory limit : Set the Max memory used by the container, which cannot exceed the physical memory.

  14. Tag : Container tag

  15. Env variable : Container environment variable

  16. Remark: Container remarks


  • Command create

Create container using the docker command

alt text

Example:

docker run -d --name mysql_test -p 3361:3306 -v /docker/mysql_data/:/var/lib/mysql/ -e MYSQL_ROOT_PASSWORD=my-passwd mysql:5.7

Command Explanation:

  1. docker run: create a container using the mysql:5.7 image
  2. -d : the container runs in the background
  3. --name: Set the container name: mysql_test
  4. -p 3361:3306: Map host 3361 port to container 3306 port
  5. -v /docker/mysql_data/:/var/lib/mysql/: Map the host /docker/mysql_data/ directory to the container /var/lib/mysql/directory for data persistence
  6. -e MYSQL_ROOT_PASSWORD=my-passwd: Specify the environment variable and set the MySQL root user password to my-passwd. If this environment variable is not specified in the mysql image, the container will not be able to run
  7. mysql:5.7: Use the mysql:5.7 image

  • Container arrangement

Quickly create containers from Compose templates

alt text

  1. Container template : Select the Compose template
  2. Create : Create Compose template
  3. Name : Enter name
  4. Description : Enter description

Pull

Download the image from Docker Hub. If the download does not move for a long time, try modifying the acceleration source in the settings.

alt text


Local image

Image local to the management server.

alt text

FunctionExampleDescribe
Pull from repository
Click view ExampleDownload the image from the Docker repository
Import imageClick view ExampleSelect a file image from the server and import the image
Build imageClick viewExampleBuild image from content or file
Cloud imageClick view ExampleDownload image from Docker Hub
Clear imageDelete unused local images
IDsha256:fb....991Image ID
Image namenextcloud:latestImage name
Size1.18 GBImage size
Creation time
2024-12-06 04:29:40
Image creation time
Containers using image
nextcloud_serverThe name of the container using this image. Click to view the container details
Create ContainerClick view ExampleCreate container from image, form Compose
PushClick view ExamplePush image to repository
ExportClick view ExampleExport image to file
DeleteDelete the image. Do not delete the image when the container is in use

Pull from repository

Local image --> Pull from repository

Docker repository download image

  • Regular pull

alt text

Example: nginx:1.27.3

Description: Image name: nginx, image version (tag): 1.27.3


  • Command pull

alt text

Example: docker pull redis

Description: Image name:redis, image version (tag):latest

Import image

Local image --> Import image

Select the file image from the server and import the image

alt text

Build image

Local image --> Build image

  • Path: Build the image from the directory. Reference alt text

  • Content: Enter content to build the image alt text

Cloud image

Local image --> Cloud image

alt text

Clear image

Local image --> Clear image

  • Delete unused local images

Push

Local image --> Push

alt text

  • push the image to the specified repository

Export

Local image --> Export

alt text

  • Export the image to the specified file

Compose

Used to define and run multiple containers. Configure through the compose.yaml file to simplify container management and deployment.

Docker compose

  • Compose Overview: alt text

Compose function introduction:

alt text

  • Add Compose : Click to add, use Compose

  • Template List : Click to view and add Compose template list

  • Search: Search Compose from this list

  • Running/Stopped : Compose running status

  • Batch Delete : Delete Compose in batches


alt text

  • ctest : Compose name

  • Creation Time: 2024-12-10 11:02:28 : Compose creation time

  • Capacity Quantity: 3 : Number of containers of Compose

  • Start : Start this Compose

  • Stop : Stop this Compose

  • Restart : Restart this Compose

  • Update lmage : Update the Compose image according to the image version of compose.yaml.

  • Delete : Delete this Compose. If the container data is not persisted, the container data will be lost. Please pay attention to data backup.


alt text

  • Container List : Display all containers under Compose

  • db_nextcloud : Container name

  • 4d8bc1e0b222 : Container ID

  • Running : Container status, operable:Stop,Start,Kill

  • 0.0.0.0:3366->3306/tcp, [::]:3366->3306/tcp : Container network information, convert the host’s3366Port mapping to container3306port.

  • Terminal : Execute the command in the container terminal

  • Logs : View single container log


alt text

  • Compose Logs : View all Compose container logs

alt text

  • compose.yaml : Compose configuration file, including container configuration, .env file definition environment variables, etc.
  • .env : Define the environment variables that this Compose needs to use, can be empty.

Add Compose

Compose --> Add Compose

  • General Creation alt text
FunctionExampleDescribe
Compose NameCtestCompose name
Compose Content
Click to view Content Compose configuration file content
.env ContentClick to view ContentDefine environment variables in Compose Content to make the configuration more flexible and maintainable
Also Save as Template
Save as Compose template, otherwise it is a one-time use
Template NameCtestSave Compose template name
NotesCtestCompose Remarks
  • Compose Content

Here is an example of the Compose configuration file for reference.

services:
  cloudreve_aria2_only1:
    image: p3terx/aria2-pro # third party image, please keep notice what you are doing
    restart: unless-stopped
    environment:
      - RPC_SECRET=your_aria_rpc_token # aria rpc token, customize your own
      - RPC_PORT=6800
    volumes:
      - ${APP_PATH}/aria2_config:/config
      - ${APP_PATH}/data:/data
    labels:
      createdBy: "bt_apps"
    networks:
      - baota_net

  cloudreve_5edk:
    image: cloudreve/cloudreve:${VERSION}
    deploy:
      resources:
        limits:
          cpus: ${CPUS}
          memory: ${MEMORY_LIMIT}
    restart: always
    depends_on:
      - cloudreve_aria2_only1
    ports:
      - ${HOST_IP}:${WEB_HTTP_PORT}:5212
    volumes:
      - ${APP_PATH}/uploads:/cloudreve/uploads
      - ${APP_PATH}/data:/data
      - ${APP_PATH}/conf.ini:/cloudreve/conf.ini
      - ${APP_PATH}/cloudreve.db:/cloudreve/cloudreve.db
      - ${APP_PATH}/avatar:/cloudreve/avatar
    labels:
      createdBy: "bt_apps"
    networks:
      - baota_net

networks:
  baota_net:
    external: true

  • .env Content

Here is an example of .env Content for reference.

VERSION=latest
CONTAINER_NAME=CONTAINER_NAME
HOST_IP=127.0.0.1
WEB_HTTP_PORT=5212
CPUS=0
MEMORY_LIMIT=0MB
APP_PATH=/www/dk_project/dk_app/cloudreve/cloudreve_5edk

Use Template

Compose --> Add Compose --> Use Template

Select a saved Compose template and use it directly.

alt text

Template List

Compose --> Template List

View saved Compose templates and perform operations such as editing and deletion.

alt text

FunctionDescribe
AddAdd Compose template
Template nameTemplate name
PathTemplate storage path
DescriptionDescription of the template
EditEdit Compose template
Pull imageObtain the image name from the Compose template and download the image, the container will not be created
DeleteDelete the Compose template. It cannot be restored after deletion. Please make backup

Add Yaml Template

Compose --> Template List --> Add

Add a Compose template and only add Yaml files

alt text

FunctionExampleDescribe
Create templatemy-nextcloudCompose template name
Remarkmy-nextcloudCompose template description
ContentClick to view ContentCompose Template content

Compose Template Example:

version: '3'
services:
 db_nextcloud:
  image: mariadb:10.7
  container_name: db_nextcloud
  restart: always
  ports:
   - 3366:3306
  networks:
   nextcloud_net: {}
  command: ["--transaction-isolation=READ-COMMITTED","--binlog-format=ROW","--innodb_read_only_compressed=off"]
  volumes:
   - db_data:/var/lib/mysql         
  environment:
   - MYSQL_ROOT_PASSWORD=btnextcloud
   - MYSQL_DATABASE=nextcloud
   - MYSQL_USER=nextcloud
   - MYSQL_PASSWORD=nextcloud

 redis_nextcloud:
  image: redis:6.2.6
  container_name: redis_nextcloud
  restart: always
  networks:
   nextcloud_net: {}
  command: ["--databases", "1"]
  volumes:
   - redis_data:/data

 nextcloud: 
  image: nextcloud:latest
  container_name: nextcloud_server
  restart: always
  networks:
   nextcloud_net: {}
  ports:
   - 8001:80
  volumes:
   - nextcloud_data:/var/www/html
  environment:
   - MYSQL_PASSWORD=nextcloud
   - MYSQL_DATABASE=nextcloud
   - MYSQL_USER=nextcloud
   - MYSQL_HOST=db_nextcloud
   - REDIS_HOST=redis_nextcloud
   - REDIS_HOST_PORT=6379
   - NEXTCLOUD_ADMIN_USER=mynextcloud
   - NEXTCLOUD_ADMIN_PASSWORD=mynextcloud
   - NEXTCLOUD_TRUSTED_DOMAINS= 127.0.0.1 localhost 192.168.247.129 docker129-nextcloud.com
      
  depends_on:  
   - db_nextcloud
   - redis_nextcloud

volumes:
 nextcloud_data:
 db_data:
  name: "nextcloud-mariadb-data"
 redis_data:

networks:
 nextcloud_net:
  name: "nextcloud_net"

Search local template

Compose --> Template List --> Add

Search for local templates on the server and add them to the Template List

alt text


Network

Networks allow communication between containers and between containers and the outside world.

alt text

FunctionDescribe
Add NetworkAdd Network
Clear NetworkDelete unused Network, it cannot be restored after deletion
Network nameNetwork Name
DriverNetwork driver, default isbridge
IPv4IPv4 version
IPv4 GatewayIPv4 gateway address
IPv6IPv6 version
IPv6 GatewayIPv6 gateway address
Tagnetwork tags
Creation timeNetwork creation time
DeleteDelete Network

Add network

Network --> Add Network

alt text

FunctionExampleDescribe
Network namemy-networknetwork name
Devicebridgenetwork driver
IPv4 subnet124.42.0.0/16IPv4 subnet mask
IPv4 gateway124.42.0.254IPv4 gateway address
IPv4 range124.42.0.0/24IPv4 range
Enable IPv6Enable or disable IPv6
IPv6 subnet2001:db8::/48IPv6 subnet mask
IPv6 gateway2001:db8::254IPv6 gateway address
Remarkmy-networknetwork remarks

Clera network

Network --> Clear Network

Delete unused networks, which cannot be restored after deletion


Volume

Persistent and shared data for containers

alt text

FunctionDescribe
Add VolumeAdd a volume
Volume nameVolume name
Mount pointDirectory to store data
ContainerUsing Volume Container Name
DriverDriver for the volume, default islocal
Creation timeVolume creation time
TagVolume label
DeleteDelete the volume. It cannot be recovered after deletion. Be sure to back up the data

Add volume

Volume --> Add Volume

alt text

FunctionDescribe
Volume nameVolume name
OptionOptions when creating volumes
TagVolume labels to classify and manage volumes
RemarkVolume remark information

Clear volume

Volume --> Clear Volume

Delete unused volumes. They cannot be recovered after deletion. Be sure to back up data.


Repository

A repository for storing and distributing container images

alt text

FunctionDescribe
Add RepositoryAdd a images repository
URLimages repository address
UsernameRepository username
Repository nameRepository name
DescriptionRepository Remarks
EditEdit repository information
DeleteDelete repository

Add Repository

Repository --> Add Repository

alt text

FunctionDescribe
Repository addressDocker image repository address
Repository nameDocker repository name
UsernameDocker repository username
PasswordDocker repository password
NamespacesDocker repository namespace
Descriptionrepository Remarks

Settings

Docker configuration, service management

alt text

FunctionDescribe
Docker server Current status
Start up, Restart, Repair, Stop Docker service, this operation will affect the status of the container, please operate with caution
Accelerate URLSet acceleration URL can solve the problem of slow image download speed. Docker needs to be restarted after modification
Docker composeSet Docker compose path
Configuration fileSet Dockerconfigurationfile path, you need to restart Docker after modification
IPv6 NetworkDocker enable or disableIPv6Network, Docker needs to be restarted after modification
Uninstall DockerUninstallDocker, please back up data before operation

Feedback or Suggestions

If you encounter problems or suggestions during use, please contact us through the following methods:

  • (Please describe in detail or provide screenshots)
  1. Forum: https://www.aapanel.com/forum
  2. Email: [email protected]