Last active
February 7, 2020 17:50
-
-
Save dbafromthecold/021aa381bd6dafe38028e3bcfda231ef to your computer and use it in GitHub Desktop.
Run mysql in a docker container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker container run ` | |
-d ` # detach the container (run it in the background) | |
--name arkkkd ` # give the container a name (arkkkd) | |
-p 3306:3306 ` # set port mapping from your computer to the container (3306 to 3306) | |
# setting environment variables for mysql | |
--env MYSQL_ALLOW_EMPTY_PASSWORD=True ` | |
--env MYSQL_DATABASE=arkkk ` | |
--env MYSQL_USER=root ` | |
# set the image to run the container from | |
mysql:8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is clear. Thank you very much. I really do appreciate. I understand that an image was created and container generated. What I'm not clear about is where my database comes in the code. I.e my local database. I assume this is where its been set in docker ..
setting environment variables for mysql
--env MYSQL_ALLOW_EMPTY_PASSWORD=True
--env MYSQL_DATABASE=arkkk
--env MYSQL_USER=root
Where arkkk is my database
If my assumption is true the I will like to know where the connection takes place with the image built for my springboot application.
I know how to create my dockfile in the application and I know how to generate my jar file already. All I want to know is the link that works btwn application and the local mysql db I.e arkkk