IntelliJ Docker Plugin, it’s magic!

IntelliJ Docker Plugin will blow you away. I’ve recently found out about it, and it is invaluable in helping me debug containers launched by AWS SAM which emulate AWS Lambda Functions.

  • install the plugin , in case it is not installed
  • go to Tools, Tool Windows, Services

It will auto-detect the running docker

Explore the running containers and you can see almost everything you want, Example:

  • you can event open a terminal on a running container (even though the terminal in not running in interactive mode)

mysql in a docker container

I have struggled a lot to find a clear tutorial for installing and running mysql server inside a docker container.

Here are my steps

0. you must have docker installed and running

  1. Pull the mysql docker image
    $ sudo docker pull mysql/mysql-server:8.0.22
  2. Start the docker container.
    Note: on my linux box I already had installed mysql server 5.7 on port 3306 So that is why I am using my machines port 3308 to bind to the docker’s mysql container port 3306
    Start mysql container:
    `
$ sudo docker run --name=mysql8 -p 3308:3306 --restart on-failure -e MYSQL_ROOT_HOST='%' -e MYSQL_ROOT_PASSWORD='admin'   -d mysql/mysql-server:8.0.22
  • here we also specify a password for the root user
  • check if the container is up with docker ps

3. Connect the mysql server

$ mysql --host 127.0.0.1 --port 3308 -u root -p