reynierpm at gmail.com
2016-Jan-29 14:09 UTC
[CentOS] SOT: Best strategy for automatize a flow that need user interaction
I am working in a Dockerfile but there is a "secure" MariaDB server script I need to run which is interactive and I don't know how to deal with this. Basically this is the flow I have follow on the script at test environment and is the same I want to achieve in the Dockerfile without user interaction by just answering as you seen on the flow below: # /usr/bin/mysql_secure_installation Enter current password for root (enter for none): [ENTER] // because there is no password OK, successfully used password, moving on... Set root password? [Y/n] n ... skipping. Remove anonymous users? [Y/n] Y ... Success! Disallow root login remotely? [Y/n] n ... skipping. Remove test database and access to it? [Y/n] Y - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] Y ... Success! Cleaning up... So I need to write a bash script or something else that could handle this automatically but has not idea, how would you take care of this?
Yamaban
2016-Jan-29 14:36 UTC
[CentOS] Re: SOT: Best strategy for automatize a flow that need user interaction
On Fri, 29 Jan 2016 15:09, reynierpm at gmail.com <reynierpm at ...> wrote:> > I am working in a Dockerfile but there is a "secure" MariaDB server script > I need to run which is interactive and I don't know how to deal with this. > > Basically this is the flow I have follow on the script at test environment > and is the same I want to achieve in the Dockerfile without user > interaction by just answering as you seen on the flow below: > > # /usr/bin/mysql_secure_installation[snip]> > So I need to write a bash script or something else that could handle this > automatically but has not idea, how would you take care of this?You have a urgend need to re-invent the wheel, no? Have a look at the offical mariab image Dockerfile, be aware that it was written with debian:latest as base: https://github.com/docker-library/mariadb/blob/master/Dockerfile.template or, be even more clever and look at the centos/mariadb image: https://hub.docker.com/r/centos/mariadb/ https://github.com/CentOS/CentOS-Dockerfiles/tree/master/mariadb/centos7 I hope this gives you some pointers to avoid wasting time, but, each to their own, find your pesonal way. Have a nice weekend. - Yamaban.
Keith Keller
2016-Jan-29 16:25 UTC
[CentOS] SOT: Best strategy for automatize a flow that need user interaction
On 2016-01-29, reynierpm at gmail.com <reynierpm at gmail.com> wrote:> I am working in a Dockerfile but there is a "secure" MariaDB server script > I need to run which is interactive and I don't know how to deal with this.Honestly, I think your best long-term strategy for getting help with Docker is a Docker list. Personally I have no major problems with OT questions, but if you ask your question someplace where everyone uses (and maybe even develops) your software you're much more likely to get a more complete and correct answer. On this list you're hoping that there's enough of a subset of users to answer your questions, and of that subset who knows how many of them really know what they're doing. If the software you were asking about were some strange obscure program that few people use any more, I could see asking everywhere you could on the off-chance that someone knows about it. But for something so popular like Docker there's no reason to go away from their discussion forums. --keith -- kkeller at wombat.san-francisco.ca.us
reynierpm at gmail.com
2016-Jan-29 16:37 UTC
[CentOS] SOT: Best strategy for automatize a flow that need user interaction
On Fri, Jan 29, 2016 at 11:25 AM, Keith Keller < kkeller at wombat.san-francisco.ca.us> wrote:> Honestly, I think your best long-term strategy for getting help with > Docker is a Docker list. Personally I have no major problems with OT > questions, but if you ask your question someplace where everyone uses > (and maybe even develops) your software you're much more likely to get > a more complete and correct answer. On this list you're hoping that > there's enough of a subset of users to answer your questions, and of > that subset who knows how many of them really know what they're doing. > > If the software you were asking about were some strange obscure program > that few people use any more, I could see asking everywhere you could on > the off-chance that someone knows about it. But for something so > popular like Docker there's no reason to go away from their discussion > forums. >No problem Keith, I will move this discussion to Docker google groups and perhaps I will get a better answer :-) thanks for your suggestion Cheers
Apparently Analagous Threads
- SOT: Best strategy for automatize a flow that need user interaction
- Re: Write content to file from Dockerfile and/or any other method
- Write content to file from Dockerfile and/or any other method
- SOT: Can Fedora be installed from Live images?
- SOT: Can Fedora be installed from Live images?