Service from sources inside Docker container

Short question: is it ok (aren’t there any contradictions with Docker ideology) to compile and start application from sources inside Docker container?


Assume that I have some hypothetical application. Let it be Java web service built with Maven, located somewhere in GitHub. Specifics doesn’t matter here.

  • Install cron tasks in a docker run command
  • Adding docker container to running OpenShift pod
  • Creating a CI pipeline for .net containerized applications
  • DB2 data source for a liberty java application
  • Why docker container exits immediately
  • How can I have MySQL persist on CoreOS Updates?
  • But before starting this service, I need to set-up several config files with right parameters, known at deployment time. Right now I can build fully-preconfigured application package with a single maven command, passing all the necessary configurations at build command.

    Now assume that I need to make it a Docker container and don’t have time to refactor it somehow right now. So I have a plan: let my docker image have Maven and Git, ENTRYSCRIPT clones my Git repository, builds and starts the application, passing all the necessary parameters via environment.

    Is it suitable plan, or it’s just wrong?

  • curl syntax error: append couchdb document failed with “conflict”?
  • /sys on the host is becoming read-only once Docker is started
  • Attack vectors when running untrusted docker images
  • Why do node_modules keep disappearing from docker after build?
  • restcomm docker image installation on windows 8.1
  • Mount linux image in docker container
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.