{"id":16642924,"url":"https://github.com/nir0s/jocker","last_synced_at":"2025-07-29T17:05:53.833Z","repository":{"id":20467634,"uuid":"23745109","full_name":"nir0s/jocker","owner":"nir0s","description":"Generate Dockerfiles from Jinja2 based templates and optionally build/push them ","archived":false,"fork":false,"pushed_at":"2015-01-06T12:18:23.000Z","size":320,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-02T08:22:51.666Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nir0s.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-06T20:53:10.000Z","updated_at":"2018-10-02T02:45:37.000Z","dependencies_parsed_at":"2022-07-31T20:47:58.215Z","dependency_job_id":null,"html_url":"https://github.com/nir0s/jocker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nir0s%2Fjocker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nir0s%2Fjocker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nir0s%2Fjocker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nir0s%2Fjocker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nir0s","download_url":"https://codeload.github.com/nir0s/jocker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238961027,"owners_count":19559400,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T08:06:49.426Z","updated_at":"2025-02-15T07:32:26.387Z","avatar_url":"https://github.com/nir0s.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"jocker\n=======\n\n[![Build Status](https://travis-ci.org/nir0s/jocker.svg?branch=master)](https://travis-ci.org/nir0s/jocker)\n\n[![Gitter chat](https://badges.gitter.im/nir0s/jocker.png)](https://gitter.im/nir0s/jocker)\n\n[![PyPI](http://img.shields.io/pypi/dm/jocker.svg)](http://img.shields.io/pypi/dm/jocker.svg)\n\n[![PypI](http://img.shields.io/pypi/v/jocker.svg)](http://img.shields.io/pypi/v/jocker.svg)\n\n`jocker` generates [Dockerfiles](https://docs.docker.com/reference/builder/) from [Jinja2](http://jinja.pocoo.org/docs/dev/) based template files. You can optionally build an image from the generated file and even more optionally, push it to a hub.\n\n### Requirements\n\n- must be run sudo-ically due to Docker's sudo requirement!\n- Python 2.6/2.7\n- [Docker](https://www.docker.com/)\n\n### Installation\n\n```shell\npip install jocker\n```\n\n### Testing\n\nDisclaimer in broken english: This like 5 hours project. Tests yet, No. Hold as test being wroten. Yes.\n\nWell.. there are \"some\" tests.. but they don't test \"build\" and \"push\". ANyways...\n\n### Usage\n\n```shell\njocker -h\nScript to run jokcer via command line\n\nUsage:\n    jocker [--varsfile=\u003cpath\u003e --templatefile=\u003cpath\u003e --outputfile=\u003cpath\u003e --dockerconfig=\u003cpath\u003e --dryrun -v]\n           [--build=\u003cstring\u003e|--push=\u003cstring\u003e]\n    jocker --version\n\nOptions:\n    -h --help                   Show this screen.\n    -f --varsfile=\u003cpath\u003e        Path to varsfile (if omitted, will assume \"vars.py\")\n    -t --templatefile=\u003cpath\u003e    Path to Dockerfile template\n    -o --outputfile=\u003cpath\u003e      Path to output Dockerfile (if omitted, will assume \"Dockerfile\")\n    -c --dockerconfig=\u003cpath\u003e    Path to yaml file containing docker-py configuration\n    -d --dryrun                 Whether to actually generate.. or just dryrun\n    -b --build=\u003cstring\u003e         Image Repository and Tag to build\n    -p --push=\u003cstring\u003e          Image Repository and Tag to push to (will target --build)\n    -v --verbose                a LOT of output (Note: should be used carefully..)\n    --version                   Display current version of jocker and exit\n```\n\n### Log location\n\nJocker log files are generated at ~/.jocker/\n\n### Generating\n\n- A `varsfile` containing a dict named `VARS` should be supplied (if omitted, will default to vars.py).\n- A `templatefile` should Jinja2-ly correspond with the variables in the aforementioned `VARS` dict (if omitted, will default to Dockerfile.template)\n- An `outputfile` should be given (if omitted, will default to `Dockerfile`)\n\n### Dryrun\n\nIf Dryrun is specified, the output of the generated template will be printed. No file will be created.\n\n### Build and Push\n\nNote that since, when building, Docker looks for a file named \"Dockerfile\", the output file must be \"Dockerfile\" if you want to be able to use the `-b` flag in conjunction with the generation of the Dockerfile from the template.\n\nYou can let jocker know that after the Dockerfile was generated, you'd like to `Build` a Docker image and optionally Push it to your chosen repository.\n\nNote that for this to work you must be logged in to Docker Hub or your private images repo from your shell.\n\nAlso note that for either of these features to work you MUST be sudo'd as it's a prerequisite of Docker.\n\nAlso also note that you can't specify both --build and --push as --push triggers a build process anyway.\n\n#### docker-py configuration for `build` and `push`\n\nA `dockerconfig` yaml file can be specified which includes something like this:\n\n```yaml\nclient:\n    base_url: 'unix://var/run/docker.sock'\n    version: '1.14'\n    timeout: 10\nbuild:\n    quiet: false\n    nocache: false\n    rm: false\n    stream: false\n    timeout:\n    encoding:\n```\n\nThis is the configuration for the docker client and for the build process as mentioned in https://github.com/docker/docker-py.\n\nIf no file was specified, some defaults will be assumed.\n\n### Vagrant\n\nThe Vagrantfile supplied (which I haven't finished yet.. will let you know once it's ready) will loadz a vbox machine, install docker and jocker on it, generate a docker image from a template and run a container based on the image in a daemonized mode to demonstrate the KRAZIE RAW POWER of jocker (and docker.. I guess *wink*)\n\n### Contributing\n\nPlease do.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnir0s%2Fjocker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnir0s%2Fjocker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnir0s%2Fjocker/lists"}