title: Run bash commands in docker-compose
body: <p>I am using default image and my requirement is to run a few Linux commands when I run docker-compose file. Os is redhat. This is my docker-compose file</p>
  <pre><code>version: '3.4'
  
  services:
    rstudio-package-manager:
      image: 'rstudio/rstudio-package-manager:latest'
      restart: always
      volumes:
        - '$PWD/rstudio-pm.gcfg:/etc/rstudio-pm/rstudio-pm.gcfg'
      command: bash -c mkdir &quot;/tmp/hello&quot;
      ports:
        - '4242:4242'
  
  </code></pre>
  <p>This is the error:</p>
  <pre><code>rstudio-package-manager_1  | mkdir: missing operand
  rstudio-package-manager_1  | Try 'mkdir --help' for more information.
  
  </code></pre>
  <p>Any help would be appreciated</p>
  <p><strong>EDIT</strong></p>
  <p>I have to run a few commands after the container starts. It can be added as a bash script too. For that, I tried this</p>
  <pre><code>version: '3.4'
  
  services:
    rstudio-package-manager:
      privileged: true
      image: 'rstudio/rstudio-package-manager:latest'
      restart: always
      environment:
        - RSPM_LICENSE=1212323123123123
      volumes:
        - './rstudio-pm.gcfg:/etc/rstudio-pm/rstudio-pm.gcfg'
        - './init.sh:/usr/local/bin/init.sh'
  
      command:
      - init.sh
      ports:
        - '4242:4242'
  
  </code></pre>
  <p>Inside init.sh is this</p>
  <pre><code>alias rspm='/opt/rstudio-pm/bin/rspm'
  rspm create repo --name=prod-cran --description='Access CRAN packages'
  rspm subscribe --repo=prod-cran --source=cran
  </code></pre>
  <p>And that also didn't work. Can anyone helpme out?</p>