Run phpMyAdmin with docker-compose
Docker Compose is a tool for defining and running multi-container applications. It is the key to unlocking a streamlined and efficient development and deployment experience.
Compose simplifies the control of your entire application stack, making it easy to manage services, networks, and volumes in a single, comprehensible YAML configuration file. Then, with a single command, you create and start all the services from your configuration file.
Compose works in all environments; production, staging, development, testing, as well as CI workflows. It also has commands for managing the whole lifecycle of your application:
- Start, stop, and rebuild services
- View the status of running services
- Stream the log output of running services
- Run a one-off command on a service
Documentation page.
Create directory for testing project:
mkdir myproject && cd myproject
Create "docker-compose.yml" file with phpMyAdmin settings:
version: '3.1'
services:
db:
image: mariadb:10.6
restart: always
environment:
MYSQL_ROOT_PASSWORD: secure_password
phpmyadmin:
image: phpmyadmin
restart: always
ports:
- 8080:80
environment:
- PMA_ARBITRARY=1
Run build:
docker-compose build
Up project:
docker-compose up
Output:
user@localhost:~/myproject$ docker-compose up
Creating myproject_db_1 ... done
Creating myproject_phpmyadmin_1 ... done
Attaching to myproject_phpmyadmin_1, myproject_db_1
db_1 | 2024-05-10 01:56:07+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.17+maria~ubu2004 started.
phpmyadmin_1 | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.2. Set the 'ServerName' directive globally to suppress this message
phpmyadmin_1 | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.2. Set the 'ServerName' directive globally to suppress this message
phpmyadmin_1 | [Fri May 10 01:56:07.599761 2024] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.59 (Debian) PHP/8.2.18 configured -- resuming normal operations
phpmyadmin_1 | [Fri May 10 01:56:07.599875 2024] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
db_1 | 2024-05-10 01:56:07+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
db_1 | 2024-05-10 01:56:07+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.17+maria~ubu2004 started.
db_1 | 2024-05-10 01:56:07+00:00 [Note] [Entrypoint]: Initializing database files
db_1 |
db_1 |
db_1 | PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
db_1 | To do so, start the server, then issue the following command:
db_1 |
db_1 | '/usr/bin/mariadb-secure-installation'
db_1 |
db_1 | which will also give you the option of removing the test
db_1 | databases and anonymous user created by default. This is
db_1 | strongly recommended for production servers.
db_1 |
db_1 | See the MariaDB Knowledgebase at https://mariadb.com/kb
db_1 |
db_1 | Please report any problems at https://mariadb.org/jira
db_1 |
db_1 | The latest information about MariaDB is available at https://mariadb.org/.
db_1 |
db_1 | Consider joining MariaDB's strong and vibrant community:
db_1 | https://mariadb.org/get-involved/
db_1 |
db_1 | 2024-05-10 01:56:09+00:00 [Note] [Entrypoint]: Database files initialized
db_1 | 2024-05-10 01:56:09+00:00 [Note] [Entrypoint]: Starting temporary server
db_1 | 2024-05-10 01:56:09+00:00 [Note] [Entrypoint]: Waiting for server startup
db_1 | 2024-05-10 1:56:09 0 [Note] Starting MariaDB 10.6.17-MariaDB-1:10.6.17+maria~ubu2004 source revision 15c75ad083a55e198ae78324f22970694b72f22b as process 100
db_1 | 2024-05-10 1:56:09 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
db_1 | 2024-05-10 1:56:09 0 [Note] InnoDB: Number of pools: 1
db_1 | 2024-05-10 1:56:09 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
db_1 | 2024-05-10 1:56:09 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
db_1 | 2024-05-10 1:56:09 0 [Note] InnoDB: Using Linux native AIO
db_1 | 2024-05-10 1:56:09 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
db_1 | 2024-05-10 1:56:09 0 [Note] InnoDB: Completed initialization of buffer pool
db_1 | 2024-05-10 1:56:09 0 [Note] InnoDB: 128 rollback segments are active.
db_1 | 2024-05-10 1:56:09 0 [Note] InnoDB: Creating shared tablespace for temporary tables
db_1 | 2024-05-10 1:56:09 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
db_1 | 2024-05-10 1:56:09 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
db_1 | 2024-05-10 1:56:09 0 [Note] InnoDB: 10.6.17 started; log sequence number 42486; transaction id 14
db_1 | 2024-05-10 1:56:09 0 [Note] Plugin 'FEEDBACK' is disabled.
db_1 | 2024-05-10 1:56:09 0 [Warning] 'user' entry 'root@cc3c89fde19d' ignored in --skip-name-resolve mode.
db_1 | 2024-05-10 1:56:09 0 [Warning] 'proxies_priv' entry '@% root@cc3c89fde19d' ignored in --skip-name-resolve mode.
db_1 | 2024-05-10 1:56:09 0 [Note] mariadbd: ready for connections.
db_1 | Version: '10.6.17-MariaDB-1:10.6.17+maria~ubu2004' socket: '/run/mysqld/mysqld.sock' port: 0 mariadb.org binary distribution
db_1 | 2024-05-10 01:56:10+00:00 [Note] [Entrypoint]: Temporary server started.
db_1 | 2024-05-10 01:56:12+00:00 [Note] [Entrypoint]: Securing system users (equivalent to running mysql_secure_installation)
db_1 |
db_1 | 2024-05-10 01:56:12+00:00 [Note] [Entrypoint]: Stopping temporary server
db_1 | 2024-05-10 1:56:12 0 [Note] mariadbd (initiated by: unknown): Normal shutdown
db_1 | 2024-05-10 1:56:12 0 [Note] InnoDB: FTS optimize thread exiting.
db_1 | 2024-05-10 1:56:12 0 [Note] InnoDB: Starting shutdown...
db_1 | 2024-05-10 1:56:12 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
db_1 | 2024-05-10 1:56:12 0 [Note] InnoDB: Buffer pool(s) dump completed at 240510 1:56:12
db_1 | 2024-05-10 1:56:12 0 [Note] InnoDB: Removed temporary tablespace data file: "./ibtmp1"
db_1 | 2024-05-10 1:56:12 0 [Note] InnoDB: Shutdown completed; log sequence number 42514; transaction id 15
db_1 | 2024-05-10 1:56:12 0 [Note] mariadbd: Shutdown complete
db_1 |
db_1 | 2024-05-10 01:56:12+00:00 [Note] [Entrypoint]: Temporary server stopped
db_1 |
db_1 | 2024-05-10 01:56:12+00:00 [Note] [Entrypoint]: MariaDB init process done. Ready for start up.
db_1 |
db_1 | 2024-05-10 1:56:12 0 [Note] Starting MariaDB 10.6.17-MariaDB-1:10.6.17+maria~ubu2004 source revision 15c75ad083a55e198ae78324f22970694b72f22b as process 1
db_1 | 2024-05-10 1:56:12 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
db_1 | 2024-05-10 1:56:12 0 [Note] InnoDB: Number of pools: 1
db_1 | 2024-05-10 1:56:12 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
db_1 | 2024-05-10 1:56:12 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
db_1 | 2024-05-10 1:56:12 0 [Note] InnoDB: Using Linux native AIO
db_1 | 2024-05-10 1:56:12 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
db_1 | 2024-05-10 1:56:12 0 [Note] InnoDB: Completed initialization of buffer pool
db_1 | 2024-05-10 1:56:12 0 [Note] InnoDB: 128 rollback segments are active.
db_1 | 2024-05-10 1:56:12 0 [Note] InnoDB: Creating shared tablespace for temporary tables
db_1 | 2024-05-10 1:56:12 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
db_1 | 2024-05-10 1:56:12 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
db_1 | 2024-05-10 1:56:12 0 [Note] InnoDB: 10.6.17 started; log sequence number 42514; transaction id 14
db_1 | 2024-05-10 1:56:12 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
db_1 | 2024-05-10 1:56:12 0 [Note] Plugin 'FEEDBACK' is disabled.
db_1 | 2024-05-10 1:56:12 0 [Note] InnoDB: Buffer pool(s) load completed at 240510 1:56:12
db_1 | 2024-05-10 1:56:12 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
db_1 | 2024-05-10 1:56:12 0 [Note] Server socket created on IP: '0.0.0.0'.
db_1 | 2024-05-10 1:56:12 0 [Note] Server socket created on IP: '::'.
db_1 | 2024-05-10 1:56:12 0 [Note] mariadbd: ready for connections.
db_1 | Version: '10.6.17-MariaDB-1:10.6.17+maria~ubu2004' socket: '/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
Open browser and navigate to http://localhost:8080 address.
Enter username (root) and password which described in docker-compose.yml file.