Docker app installer

install_mysql57_base_docker.sh

A helper.sh-hosted script that creates the /data/mysql5.7 layout, writes a baseline MySQL 5.7 config, pulls mysql:5.7.44, and runs a restartable container with mounted data, config, and init directories.

One-liner

curl -fsSL helper.sh/install_mysql57_base_docker.sh | sudo bash
wget -qO- helper.sh/install_mysql57_base_docker.sh | sudo bash

Requirements

  • Linux host
  • Docker installed and running
  • root privileges or sudo
  • Port 3306 available
  • /data writable on the host

Best for

  • Bring up a MySQL 5.7 instance quickly on a Docker-ready host
  • Keep MySQL data, config, and init SQL scripts under /data/mysql5.7 on the host
  • Standardize a reviewed bootstrap path for legacy applications that still depend on MySQL 5.7

Highlights

  • Creates /data/mysql5.7/data, conf.d, and init automatically
  • Pulls mysql:5.7.44 and starts a restartable MySQL 5.7 container
  • Generates a strong root password automatically if you do not provide one
  • Supports optional initial database, user, and password creation on first boot

Recommended procedure

  1. Confirm Docker is already installed and the host can expose port 3306.
  2. Run the helper.sh command with sudo or as root.
  3. Let the script prepare /data/mysql5.7, pull mysql:5.7.44, and create the container.
  4. Record the printed root password and optional user credentials before handing the database to an application team.

Safety notes

  • Do not expose MySQL 5.7 directly to the public internet without network controls.
  • Record the generated root password immediately if you did not provide one.
  • Back up /data/mysql5.7 before replacing or recreating a production container.

Scenario article

Deploy MySQL 5.7 in Docker with /data/mysql5.7 as the host mount

A practical guide to using install_mysql57_base_docker.sh when Docker is already ready and you need a predictable MySQL 5.7 instance with host-mounted data, config, and init SQL.

Related topics

Ubuntu 24.04 deployment basics

Install Docker, bootstrap common runtime services, and keep fresh Ubuntu 24.04 hosts ready for application rollout.

Open topic

Docker base services for application hosts

Use helper.sh scripts to standardize containerized Nginx, MySQL, Redis, PHP, and Workerman services on long-lived hosts.

Open topic

Problem pages

How to install MySQL 5.7 with Docker

Run an older MySQL 5.7 version with predictable mounted directories and generated credentials on a modern Docker host.

Open page