Developing in a Docker image that's under version control

Currently have a pipeline that I use to build reports in R and publish in Jekyll. I keep my files under version control in github and that’s been working great so far.

Recently I began thinking about how I might take R, Ruby and Jekyll and build a docker image that any of my coworkers could download and run the same report without having all of the packages and gems set up on their computer. I looked at Docker Hub and found that the automated builds for git commits were a very interesting feature.

  • Recover Percona Xtradb in container
  • Tomcat deployment using Docker and Kubernetes
  • What is the difference b/w a docker image generated by docker-compose build vs docker build?
  • Access other containers of a pod in Kubernetes
  • Setup Java development environment with Docker
  • Not use docker-machine
  • I want to build an image that I could use to run this configuration and keep it under version control as well and keep it up to date in Docker Hub. How does something like this work?

    If I just kept my current setup I could add a dockerfile to my repo and Docker Hub would build my image for me, I just think it would be interesting to run my work on the same image.

    Any thoughts on how a pipeline like this may work?

  • What run flags are included in my Docker Container
  • docker-compose NodeJS + Mongodb with mongoose, dynamically get the mongo container ip
  • Unable to install docker 1.5 on ubuntu 14.04 64bit
  • Script test to see if a tool is already loaded?
  • How to connect to local Docker on Windows with Eclipse?
  • bash: How do I write a shell script to sftp a mongodump from a MongoDB Docker container inside a DigitalOcean droplet to backup the MongoDB database?
  • One Solution collect form web for “Developing in a Docker image that's under version control”

    Docker Hub build service should work (https://docs.docker.com/docker-hub/builds/). You can also consider using gitlab-ci or travis ci (gitlab will be useful for privet projects, it also provides privet docker registry).

    You should have two Dockerfiles one with all dependencies and second very minimalistic one for reports (builds will be much faster). Something like:

    FROM base_image:0.1
    COPY . /reports
    WORKDIR /reports
    RUN replace-with-requiered-jekyll-magic
    

    Dockerfile above should be in your reports repository.

    In 2nd repository you can crate base image with all the tools and nginx or something for serving static files. Make sure that nginx www-root is set to /reports. If you need to update the tools just update base_mage tag in Dockerfile for reports.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.