title: executing a command in Dockerfile not working
body: <p>Dockerfile:</p>
  
  <pre><code>FROM golang:latest
  
  # COPY  kube/command.sh .
  RUN apt-get update
  
  # To be able to do go run !(*_test).go
  RUN apt-get install dnsutils  -y
  
  # CMD [ "shopt -s extglob" ]
  CMD [ "sh command.sh" ]
  # RUN bash -c shopt -s extglob
  # RUN "sh command.sh"    
  </code></pre>
  
  <p>Also tried with a script file(command.sh):</p>
  
  <pre><code>#!/bin/sh
  
  shopt -s extglob
  </code></pre>
  
  <p>And <code>RUN bash -c shopt -s extglob</code></p>
  
  <p>Building Dockerfile I get this:</p>
  
  <pre><code>bash: !: event not found
  </code></pre>
  
  <p>If I run the container and manually doing <code>shopt -s extglob</code>: it works.</p>
  
  <p>Do you know why?</p>