Running and connecting to different MySQL servers in Docker containers

Running and exposing default MySQL port: docker run -e MYSQL_ROOT_PASSWORD=mypassword -p 3306:3306 -d mysql mysql -u root -p Running with a different exposed port on the host: docker run -e MYSQL_ROOT_PASSWORD=mypassword -p 3307:3306 -d mysql Connecting to server on different port : -P option, but also requires -h for host, otherwise seems to connect to …

Updating local versions of Docker images if using the latest tag

I have an ubuntu:latest image pulled locally from a couple of years ago, and it’s obviously not the latest since it’s over 2 years old. ‘docker images’ shows: ubuntu latest d5ca7a445605 2 years ago 65.6MB If I run the image with -it and cat the /etc/lsb-release file, it shows it’s 20.04. Docker Hub is currently …