[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Running commands



On Thu, Jan 7, 2016 at 9:54 AM, Rodolfo Carvalho <rcarvalh redhat com> wrote:
On Thu, Jan 7, 2016 at 9:25 AM, Alejandro Nieto Boza <ale90nb gmail com> wrote:
You're right, I want to start a mysql server but changing the mysql_datadir (the datadir doesn't exist, so I need to create it ussing variables). 


I think the necessary commands would be:

"mkdir", "${MYSQL_DATADIR}",
"mysqld-master", "--datadir=${MYSQL_DATADIR}"

Looking at documentation, there are only examples with one command:

"command":[
    "/usr/bin/command", "arg1", "arg2"
],

Is it possible to indicate various commands in the template?


No, the command syntax is for a single executable with zero or more arguments. See https://docs.docker.com/engine/reference/builder/#run (2nd form).


Ah, forgot to mention, it's a no, but you can run multiple commands in a shell:

"command":[
    "/usr/bin/bash", "-c", "do-sth && do-sth-else"
],


 


I'm thinking about how best you could change the dir and will reply here.
BTW, why do you need to use a different dir than the default?


--
Rodolfo Carvalho

OpenShift Developer Experience




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]