Create a docker-compose.yml file

version: "3.1"
services:
    db:
        image: mysql:8.0
        ports:
            - "3306:3306"
        command: --default-authentication-plugin=mysql_native_password
        environment:
            MYSQL_DATABASE: test
            MYSQL_USER: user
            MYSQL_PASSWORD: userpasswd
            MYSQL_ROOT_PASSWORD: rootpasswd
        networks:
            - default
    phpmyadmin:
        image: phpmyadmin/phpmyadmin
        links:
            - db:db
        ports:
            - 8000:80
        environment:
            MYSQL_USER: user
            MYSQL_PASSWORD: userpasswd
            MYSQL_ROOT_PASSWORD: rootpasswd

and then run the following command

docker-compose up -d

if its occurs error , you can look up logs

docker logs container-id