A
A
Alexander2015-06-22 20:36:13
ubuntu
Alexander, 2015-06-22 20:36:13

How to run mysql in docker container on startup?

There is a Docker container in which mysql and apache live. I can't seem to add them to startup. Anyone in the know, please let me know!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nazar Mokrinsky, 2015-06-23
@nazarpc

1) To do this, you need an init system, and, preferably, some kind of supervisor who will monitor falls and pick everything up if something happens, I recommend https://github.com/phusion/baseimage-docker as a proven solution with good documentation ( I strongly recommend that you read it, everything is written there)
2) Docker encourages the launch of one service in one container, then you can link one to another, for example, to access MySQL from a container that already has Apache2 + mod_php (or whatever you have), for There are official containers for this: https://registry.hub.docker.com/_/php/ https://registry.hub.docker.com/_/mysql/ (or MariaDB as an alternative to https://registry.hub. docker.com/_/mariadb/ )
I take this opportunity to take a look at https://github.com/nazar-pc/docker-webserver - an easy-to-use set of containers for PHP (or just static) with config, easy backup / restore and update.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question