How to downgrade the version of mysql

How to downgrade the version of mysql ??
currently the latest version of mysql in docker is 8 i would like to downgrade my mysql version to 5.5 or 5.6 how do you do it???