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.

  • difference between docker attach and docker exec
  • Jupyterhub with dockerspawner does not run - error 502
  • Why does the new built image does not have the new installed package?
  • How can I create a docker image then upload it to my repositary? [closed]
  • Docker: failed to pull image (oversized record received with length 20527
  • Storing different Docker Images in single Docker repository
  • 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?

  • How to install docker on CentOS 7?
  • Can not ping docker in macOS
  • Docker Container: time/timezone wrong
  • What is a Docker tag (looking for a definition)?
  • Pull image from another Docker Machine
  • Using Docker, how do you execute PHP composer commands?
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.