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:

  • docker-compose down - network is external, skipping
  • How do I pull a local insecure registry image in a rancher service?
  • How to upgrade Openshift Origin Docker to latest version?
  • Compose not working with Dockerfile using FROM
  • fdisk doesn't find loop device in docker
  • How to build a docker container for a synchronized source code?
  • ADD nginx/nginx-build.sh /home/fbelov/nginx-build.sh 
    RUN ["/home/fbelov/nginx-build.sh"]
    

    but it doesn’t work

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

  • error when I make peer in my virtual box
  • “500 Internal Server Error” when pushing docker images using gcloud and a service account with “Owner” permission
  • Strategy for versioning Docker images linked to other contains via docker compose
  • is it possible to reset urandom when starting docker?
  • node.js proxy app in docker behind nginx proxy
  • Settings to Windows Firewall to allow Docker for Windows to share drive
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.