title: Inserting a conditional RUN statement inside a dockerfile
body: <p>I am trying to write a docker file which will run a RUN command to search for a word in a package.json file and act upon it:</p>
  
  <p>this is my simple dockerfile:</p>
  
  <pre><code>FROM ubuntu:14.04
  
  COPY package.json package.json
  
  RUN if grep -q "grunt" package.json; then echo succeed fi
  </code></pre>
  
  <p>as you can see i just want a simple if statement but it get this error:</p>
  
  <pre><code>Step 2 : RUN if grep -q "grunt" package.json; then echo succeed fi
   ---&gt; Running in af460df45239
  /bin/sh: 1: Syntax error: end of file unexpected (expecting "fi")
  INFO[0001] The command [/bin/sh -c if grep -q "grunt" package.json; then echo succeed fi] returned a non-zero code: 2
  </code></pre>
  
  <p>How should i run my command?
  thanks.</p>