Answers: <p>I think it depends on the context.</p>
  <p>I feel your pain with regard to needing to tinker and tweak a MySQL/MariaDB instance. It's not extremely difficult to get an instance up and running and THEN populate the DB from, say, a mysqldump by attaching volumes to the MySQL instance either using a Dockerfile for the instance or by &quot;manually&quot; bash-ing into it and loading your tables, tweaking your network config, setting up complex user permissions, etc.</p>
  <p>But it's usually a STRUGGLE to deploy a &quot;ready to go&quot; mysql instance from a docker-compose.yml in my initial experience using Docker Composer for a MySQL container in an app deployment, but it IS doable.</p>
  <p>What kind of scale are you trying to achieve? Do you NEED Kubernetes or Docker Swarm? I think in the case of most apps, the answer is honestly no. You can almost always come up with a crafty workaround with ba(sh) scripts or RUN/CMD (Dockerfile) or command: (docker-compose).</p>
  <p>Are you trying to support an automated deployment? or just get an app up and running? or trying to increase resilience? Increase capacity at scale?</p>
  
Answers: CC BY-SA 4.0
Answers: 2020-09-22T22:18:47.243Z
Answers: those are the questions I should be asking.  For the moment, I'd go with option #1:  automated deployment.
Answers: Nicholas Saunders
Answers: CC BY-SA 4.0
Answers: 2020-09-22T22:43:08.183Z
Answers: docker-compose is likely what you want to use in conjunction with one or more Dockerfiles. You can build each individual container and configure your volumes and the docker network(s) in a myriad of (often ridiculously and confusing) ways by using different "versions" of docker-compose. I think the "latest" docker-compose version that seems to be in "wide spread use" is `version: "3.7"` which seems to have deprecated a TON of the k/v pairs used in docker-compose.yml files, like "depends_on:" and there are a few new (more "verbose") ways to granular config your docker volumes. Its a challenge..
Answers: CoolElectricity
Answers: CC BY-SA 4.0
Answers: 2020-09-22T18:20:10.460Z
Answers: 2020-09-22T18:20:10.460Z
Answers: CoolElectricity
Body: <p>From fifty-thousand feet, how are, for example, multiple <code>MySQL</code> containers handled?</p>
  <p>In the context of my limited experience, <a href="https://devops.stackexchange.com/q/12449/23443">simply running the container is insufficient, with additional configuration</a> required.  It just seems not quite so repeatable if, after running the container, it must be further tinkered with before any CRUD operations.  Or is that just the process?</p>
  
Tags: <docker><kubernetes><containers><docker-swarm><orchestration>
Title: How to deploy MySQL server repeatedly
UserDisplayName: Nicholas Saunders
ThreadText: # How to deploy MySQL server repeatedly
  
  (Asked by: username_0 on 2020-09-21)
  
  From fifty-thousand feet, how are, for example, multiple `MySQL` containers handled?
  
  In the context of my limited experience, [simply running the container is insufficient, with additional configuration](https://devops.stackexchange.com/q/12449/23443) required. It just seems not quite so repeatable if, after running the container, it must be further tinkered with before any CRUD operations. Or is that just the process?
  
  **Tags:** docker, kubernetes, containers, docker-swarm, orchestration
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-09-22. Score: 1 | Accepted answer
  
  I think it depends on the context.
  
  I feel your pain with regard to needing to tinker and tweak a MySQL/MariaDB instance. It's not extremely difficult to get an instance up and running and THEN populate the DB from, say, a mysqldump by attaching volumes to the MySQL instance either using a Dockerfile for the instance or by "manually" bash-ing into it and loading your tables, tweaking your network config, setting up complex user permissions, etc.
  
  But it's usually a STRUGGLE to deploy a "ready to go" mysql instance from a docker-compose.yml in my initial experience using Docker Composer for a MySQL container in an app deployment, but it IS doable.
  
  What kind of scale are you trying to achieve? Do you NEED Kubernetes or Docker Swarm? I think in the case of most apps, the answer is honestly no. You can almost always come up with a crafty workaround with ba(sh) scripts or RUN/CMD (Dockerfile) or command: (docker-compose).
  
  Are you trying to support an automated deployment? or just get an app up and running? or trying to increase resilience? Increase capacity at scale?
  
  > **Comments:**
  > **username_0**: those are the questions I should be asking.  For the moment, I'd go with option #1:  automated deployment.  
  > **username_1**: docker-compose is likely what you want to use in conjunction with one or more Dockerfiles. You can build each individual container and configure your volumes and the docker network(s) in a myriad of (often ridiculously and confusing) ways by using different "versions" of docker-compose. I think the "latest" docker-compose version that seems to be in "wide spread use" is `version: "3.7"` which seems to have deprecated a TON of the k/v pairs used in docker-compose.yml files, like "depends_on:" and there are a few new (more "verbose") ways to granular config your docker volumes. Its a challenge..  
  
  ---
  
  