Skip to content

Instantly share code, notes, and snippets.

@jpcaparas
Last active February 7, 2024 09:11
Show Gist options
  • Save jpcaparas/61f8570d39ef4f3e78d7a09360278933 to your computer and use it in GitHub Desktop.
Save jpcaparas/61f8570d39ef4f3e78d7a09360278933 to your computer and use it in GitHub Desktop.
Quickly spin up a MySQL container that's bind-mounted to a host volume and include an accompanying PHPMyAdmin UI
#!/bin/bash
# Some args are OrbStack-specific
# To enter the instance, run:
# docker exec -it kiwinoy_mysql8 mysql -u root -p
docker run \
-d \
--rm \
--name kiwinoy_mysql8 \
-p 3307:3306 \
-v kiwinoy_mysql8:/var/lib/mysql \
-e MYSQL_ROOT_PASSWORD=secret \
-d mysql:8
docker run \
-d \
--rm \
--name kiwinoy_pma \
--link kiwinoy_mysql8:db \
-l dev.orbstack.domains=pma.local \
-p 8080:80 \
phpmyadmin/phpmyadmin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment