Inserting a conditional RUN statement inside a dockerfile

后端 未结 1 1128
鱼传尺愫
鱼传尺愫 2021-01-17 07:18

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:

this is my simple dockerfile:

         


        
1条回答
  •  一生所求
    2021-01-17 07:57

    Just like when typing at the shell, you need either a newline or a semicolon before fi:

    RUN if grep -q "grunt" package.json; then echo succeed; fi
                                                 add this ^
    

    0 讨论(0)
提交回复
热议问题