All Projects → jen-soft → pydocker

jen-soft / pydocker

Licence: MIT license
Easy generator Dockerfile for humans

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to pydocker

ftp-action
Automate copying your files via FTP using this GitHub action.
Stars: ✭ 90 (+210.34%)
Mutual labels:  deploy
cfn-deploy
A useful GitHub Action to help you deploy cloudformation templates
Stars: ✭ 14 (-51.72%)
Mutual labels:  deploy
coinbin.org
₿ A Human–Friendly API Service for Crypto Currency Information.
Stars: ✭ 255 (+779.31%)
Mutual labels:  for-humans
yoda
Simple tool to dockerize and manage deployment of your project
Stars: ✭ 69 (+137.93%)
Mutual labels:  deploy
unity-test-runner
Run tests for any Unity project
Stars: ✭ 134 (+362.07%)
Mutual labels:  deploy
ngx-aws-deploy
☁️🚀 Deploy your Angular app to Amazon S3 directly from the Angular CLI 🚀☁️
Stars: ✭ 84 (+189.66%)
Mutual labels:  deploy
snitch
Keep updated about all deploys on Tsuru
Stars: ✭ 16 (-44.83%)
Mutual labels:  deploy
ladep
Ladep is the world's best deployer for Laravel framework. It's the best way to deploy your Laravel projects.
Stars: ✭ 46 (+58.62%)
Mutual labels:  deploy
kahoy
Simple Kubernetes raw manifests deployment tool
Stars: ✭ 33 (+13.79%)
Mutual labels:  deploy
docker-wordmove
Docker image to run Wordmove
Stars: ✭ 16 (-44.83%)
Mutual labels:  deploy
deploy
Deploy Development Builds of Open Cluster Management (OCM) on RedHat Openshift Container Platform
Stars: ✭ 133 (+358.62%)
Mutual labels:  deploy
action-netlify-deploy
🙌 Netlify deployments via GitHub actions
Stars: ✭ 32 (+10.34%)
Mutual labels:  deploy
QLD
A graphical tool to make the deploying of Qt quick applications on linux platform faster
Stars: ✭ 18 (-37.93%)
Mutual labels:  deploy
ember-cli-blog
Tom Dale's blog example updated for the Ember CLI
Stars: ✭ 87 (+200%)
Mutual labels:  deploy
nocd
🏄 一个轻量可控的持续交付系统。支持 Git 部署、交付通知、中断交付。
Stars: ✭ 59 (+103.45%)
Mutual labels:  deploy
actions-deploy-gist
📌 Deploy file to Github Gist
Stars: ✭ 26 (-10.34%)
Mutual labels:  deploy
deploy shard mongodb
This repository has a set of scripts and resources required for deploying MongoDB replicated sharded cluster.
Stars: ✭ 17 (-41.38%)
Mutual labels:  deploy
XUnityDeploy
Compile Unity to iOS[Android] client
Stars: ✭ 18 (-37.93%)
Mutual labels:  deploy
epf-transmitter
astrizhachuk.github.io/epf-transmitter/
Stars: ✭ 32 (+10.34%)
Mutual labels:  deploy
zoom-ci
Zoom-CI(简称Zoom),是一个轻量易安装的自动化部署工具,支持本地和远程两种项目部署类型。
Stars: ✭ 19 (-34.48%)
Mutual labels:  deploy

pydocker

Easy generator Dockerfile for humans

Let's use power of python for generate dockerfile!

Advantages:
    - all features from python: variables, multiline strings, code reuse.
    - keep all your code in one file [bash, python, conf, ...]
    - generate many docker files from one template [testing, production, ]
    - generate sequence [Dockerfile.debian => Dockerfile.python => Dockefile.yourapp, ...]
    - or if you not expert in sed, awk - you can use python for modify conf files : )

easy code, easy costomize

Install

# sudo apt-get install python-setuptools && sudo easy_install pip
pip install -U pydocker

Using

# Dockerfile.py
import sys
import logging
import pydocker  # github.com/jen-soft/pydocker

logging.getLogger('').setLevel(logging.INFO)
logging.root.addHandler(logging.StreamHandler(sys.stdout))


class DockerFile(pydocker.DockerFile):
    """   add here your custom features   """


d = DockerFile(base_img='debian:8.2', name='jen-soft/custom-debian:8.2')

d.RUN_bash_script('/opt/set_repo.sh', r'''
cp /etc/apt/sources.list /etc/apt/sources.list.copy

cat >/etc/apt/sources.list <<EOL
deb     http://security.debian.org/ jessie/updates main
deb-src http://security.debian.org/ jessie/updates main
deb     http://ftp.nl.debian.org/debian/ jessie main
deb-src http://ftp.nl.debian.org/debian/ jessie main
deb     http://ftp.nl.debian.org/debian/ testing main
EOL

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 04EE7237B7D453EC
apt-get clean && apt-get update
''')

d.EXPOSE = 80
d.WORKDIR = '/opt'

# d.ENTRYPOINT = ["/opt/www-data/entrypoint.sh"]
d.CMD = ["python", "--version"]

d.build_img()
# >_ console:

python3 Dockerfile.py
docker images

Alternative uage:

  • install from repo (without pip)

    F=$(python -c "import site; print(site.getsitepackages()[0]+'/pydocker.py')")
    sudo wget -v -N raw.githubusercontent.com/jen-soft/pydocker/master/pydocker.py -O $F
    
  • without any installation:

    try: from urllib.request import urlopen         # python-3
    except ImportError: from urllib import urlopen  # python-2
    exec(urlopen('https://raw.githubusercontent.com/jen-soft/pydocker/master/pydocker.py').read())
    #
    d = DockerFile(base_img='debian:8.2', name='jen-soft/custom-debian:8.2')
    # ...
    • Helpful if you need just build img
  • not required installation

    #!/usr/bin/env python
    # -*- coding: utf-8 -*-
    try:
        from pydocker import DockerFile  # pip install -U pydocker
    except ImportError:
        try:
            from urllib.request import urlopen         # python-3
        except ImportError:
            from urllib import urlopen  # python-2
        #
        exec(urlopen('https://raw.githubusercontent.com/jen-soft/pydocker/master/pydocker.py').read())
    #
    import sys
    import logging
    
    logging.getLogger('').setLevel(logging.INFO)
    logging.root.addHandler(logging.StreamHandler(sys.stdout))
    
    
    class MyDockerFile(DockerFile):
        """   add here your custom features   """
    #
    
    
    d = MyDockerFile(base_img='debian:8.2', name='jen-soft/debian:8.2')
    # ...
    • Helpful if you need share your Dockerfile.py

License

This work is dual-licensed under Apache License 2.0 and MIT License. You can choose between one of them if you use this work.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].