Can I run custom .sh files while building docker image?

I want to use docker with custom nginx module. So I have to download nginx, extract, rebuild and install it. It’s a lot of work.

Can I implement this logic in .sh file and ask docker to execute this file while building image. I tried:

  • Unable to run cygwin in Windows Docker Container
  • Docker network settings and iptables NAT
  • Unable to deploy Docker composer to AWS ECS
  • docker 1.12 swarm cluster cannot serve static files
  • Gradle build fails while executing './gradlew build installDist --info' inside docker container
  • Exec sed command to a docker container
  • ADD nginx/ /home/fbelov/ 
    RUN ["/home/fbelov/"]

    but it doesn’t work

     ---> Running in e90e561c3b80
    /bin/sh: 1: /home/fbelov/ not found
    INFO[0001] The command [/bin/sh -c /home/fbelov/] returned a non-zero code: 127

  • Kitchen and Kitchen-docker
  • Compressing mysql data folder to save in a docker image
  • Docker Tooling for Eclipse - how to connect to docker daemon running inside VM
  • Prevent volume creation on docker run
  • Access host machine dns from a docker container
  • docker run vs. docker-compose up: same image, different outcome
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.