Coder Social home page Coder Social logo

docker-autobuilder's Introduction

docker-autobuilder

Docker Automated builds support for private repositories.

A very simple setup with openresty/nginx and a couple small shell scripts. Runs inside a docker container.

WHY?

Question: Docker Hub already has automated builds. Why did you do this? Answer: Docker Hub does not currently support private git submodules from github because deploy keys cannot be re-used.

How

First move an id_rsa and id_rsa.pub into ssh/ that has credentials for your github account.

Now we build the image:

docker build -t you/docker-autobuilder .

NOTE: DONT PUSH THIS PUBLICLY. Its got your private key in it!

Then make a repos configuration repos/repos.lua based off of example.lua inside that configures which repos you want to build.

If I wanted to build the github repo notacatjs/dommit into the docker image notacatjs/dommit-autobuild, I'd put this into the repos/repos.lua:

imagemap = {
  ["notacatjs/dommit"] = "notacatjs/dommit-autobuild"
};

return imagemap

Now we run the autobuilder:

docker run \
    --volume $(pwd)/repos:/app/repos \
    --volume /var/run:/host/var/run \
    --publish 80:80 \
    --env DOCKER_EMAIL="[email protected]" \
    --env DOCKER_PASSWORD="yourpassword" \
    --env DOCKER_USERNAME="yourusername" \
    --env DOCKER_INDEX="https://index.docker.io/v1/"
    you/docker-autobuilder

To test:

curl -XPOST \
    'http://yourdockerhost:80/' \
    -H'Content-Type: application/json'\
    -d'{ \
        "ref": "refs/heads/master",
        "repository": { \
            "full_name": "org/repo" \
        }'

You can monitor logs with docker logs.

Setup as a github webhook with no secret for push events, and there ya go. Your own autobuilder!

docker-autobuilder's People

Contributors

yanatan16 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

rafflecopter

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.