Sometimes, novice users might need a few useful commands to deal with docker images.
How to open Terminal (bash)
If you use Windows and you will need to enter bash (to install other extensions or do whatever you want in terminal), after running the container, you can enter there from cmd, using command:
FOR /F "tokens=*" %g IN ('docker ps --filter "ancestor=YOUR_IMAGE_NAME_HEREEEE" -q') do (docker exec -ti %g bash)
Mounting custom folder
If you want to run it on custom port or want to mount your local folder as
www-root (or even a separate plugin cases) for wordpress, then you can run the new container by:
docker run -d -p 8080:80 -v D:\\your-folder\\:/var/www/html/ -it wp-php8
Connecting to local Mysql server
If you have a case, that you want to connect the docker WP to local mysql server (i.e. to
wampserver or alike…) then enter mysql console and create & grant privileges to new user:
CREATE USER 'myuser1'@'*' IDENTIFIED BY 'myuser1'; GRANT ALL PRIVILEGES ON * . * TO 'myuser1'@'*';
and in docker WP installation, you should put database host as
192.168.1.xxx (correct that with your network ip. Note, you might need to append the port too, i.e.