diff --git a/.bumpversion.cfg b/.bumpversion.cfg new file mode 100644 index 0000000..0f8f03e --- /dev/null +++ b/.bumpversion.cfg @@ -0,0 +1,6 @@ +[bumpversion] +current_version = 2.0.2 + +[bumpversion:file:setup.py] + +[bumpversion:file:dock/__init__.py] diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d7e5bfb --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.pyc +/dist/ +/*.egg-info +/build diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ba8535..58d7589 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # dock changelog +## Unreleased + - Rewrite dock to Python for easier development. + - Use stable Docker image tags where possible to allow reproducible setups. + - Only allow a single formula to be started at a time **(BREAKING)**. + ## 1.3.0 - dock is now compatible with docker-machine thanks to [@codingfabian](https://github.com/CodingFabian). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..cd44a2f --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,32 @@ +# Contributing + +## Releasing to PyPi +Follow the guide on https://packaging.python.org/en/latest/distributing/ +release ideas: https://gist.github.com/audreyr/5990987 + +```bash +# ensure twine is installed +$ pip install --upgrade twine bumpversion +# remove previous build +$ rm -rf build dist *.egg-info +# Update changelog +$ git add CHANGELOG.md +$ git commit -m "docs(changelog): Prepare changelog for upcoming release" +# increase the version number +$ bumpversion --commit --tag (major|minor|patch) +# generate package info used for the upload to the PyPi registry +$ python setup.py egg_info +# build the project +$ python setup.py bdist_wheel --universal +# ensure that a ~/.pypirc file exists +$ cat ~/.pypirc +# upload +$ twine upload dist/* +``` + +## Symlinking cloned repository +pip install -e . + + +## TODOs + - [ ] Handle Docker run errors (see screenshot from 2016-01-10 8:22) diff --git a/FAQ.md b/FAQ.md new file mode 100644 index 0000000..4db5e52 --- /dev/null +++ b/FAQ.md @@ -0,0 +1,4 @@ +# FAQ + +## No space left on device with docker-machine +See http://stackoverflow.com/questions/31909979/docker-machine-no-space-left-on-device diff --git a/common b/common deleted file mode 100644 index 5962f98..0000000 --- a/common +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash - -force_stop() { - docker stop $1 &> /dev/null - docker rm $1 &> /dev/null -} - - -inspect() { - if hash docker-machine 2>/dev/null; then - docker-machine ssh $DOCKER_MACHINE_NAME docker inspect --format=$2 $1 - elif hash boot2docker 2>/dev/null; then - boot2docker ssh docker inspect --format=$2 $1 - else - docker inspect --format=$2 $1 - fi -} - - -get_ip() { - if hash docker-machine 2>/dev/null; then - docker-machine ip $DOCKER_MACHINE_NAME 2>/dev/null - elif hash boot2docker 2>/dev/null; then - boot2docker ip 2>/dev/null - else - # The following gives the ip address of the container. We - # don't need this information though. On Linux systems the - # systems can be accessed via 127.0.0.1 - # docker inspect --format={{.NetworkSettings.IPAddress}} $1 - - echo "127.0.0.1" - fi -} - - -run() { - docker run "$@" - local status=$? - if [ $status -ne 0 ]; then - echo >&2 - echo "Failed to start the Docker container." >&2 - exit 1 - fi - - local container_id="$(docker ps -n=1 | tail -n 1 | awk '{print $1}')" - local container_name=$(inspect $container_id '{{.Name}}') - # strip the leading / character - container_name=${container_name#?} - - local container_ip=$(get_ip $container_id) - - local host_ports=$(inspect $container_id '' | \ - grep HostPort | \ - sed 's/[^0-9]*//g' | \ - sort -nu) - - echo "Container started" - echo "Name: $container_name" - echo "IP: $container_ip" - echo "Ports: $(echo $host_ports | tr '\\n' ',')" -} diff --git a/dock b/dock deleted file mode 100755 index d0263d3..0000000 --- a/dock +++ /dev/null @@ -1,196 +0,0 @@ -#!/bin/bash -# -# Script for easily running development systems in docker containers -# https://github.com/bripkens/dock -# - -remote_repo=https://github.com/bripkens/dock.git -local_repo=$HOME/.dock-formulas -working_dir=`pwd` - - -version() { - echo "$(basename $0) 1.3.0 by Ben Ripkens and contributors" - echo "https://github.com/bripkens/dock" -} - - -usage() { - version -cat << EOF >&2 - -easily bootstrap development tools with Docker - -Usage: - $(basename $0) [options] - $(basename $0) [formula...] - -Example: - $(basename $0) redis - -Options: - -l, --list List available formulas - -c, --cat [formula] Display formula details - -u, --upgrade Upgrade list of available formulas - -d, --rm Stop and remove all containers - -h, --help Display this help text - -v, --version Display current script version -EOF -} - - -clone() { - if [ $1 -a $1 = '--silently' ]; then - git clone -q "$remote_repo" "$local_repo" - else - echo "Cloning $remote_repo to $local_repo" - git clone "$remote_repo" "$local_repo" - fi -} - - -upgrade() { - if [ ! -e "$local_repo/.git" ]; then - clone - else - cd "$local_repo" - git pull origin master - fi -} - - -init() { - if [ ! -e "$local_repo/.git" ]; then - clone $1 - fi -} - - -list() { - init --silently - - echo ":: Build-in Formulas" - listFormulas "$local_repo"/formulas - if [ -d "$working_dir"/.dock-formulas ]; then - echo ":: Project Formulas" - listFormulas "$working_dir"/.dock-formulas - fi -} - -listFormulas() { - for path in $(ls "$1" | sort -f); do - filename=$(basename $path) - echo "${filename%.*}" - done -} - - -unknown_formula() { - echo "Unknown formula: $1" >&2 - echo >&2 - echo "If you feel like $1 should be supported by dock, please" >&2 - echo "consider opening an issue or sending a pull request to" >&2 - echo >&2 - echo " https://github.com/bripkens/dock" >&2 - echo >&2 - echo "Thanks!" >&2 -} - - -dump() { - init --silently - - formula="$local_repo/formulas/$1" - - if [ -e "$formula" ]; then - cat $formula - else - unknown_formula $1 - fi -} - - -check_docker_usage_possible() { - docker ps > /dev/null - local status=$? - if [ $status -ne 0 ]; then - echo >&2 - echo "It seems like there are issues with your" >&2 - echo "Docker setup. Please see the error above." >&2 - exit 1 - fi -} - - -start() { - init --silently - check_docker_usage_possible - - project_formula="$working_dir/.dock-formulas/$1" - builtin_formula="$local_repo/formulas/$1" - - if [ -e "$project_formula" ]; then - startFormula $1 $project_formula - elif [ -e "$builtin_formula" ]; then - startFormula $1 $builtin_formula - else - unknown_formula $1 - fi -} - -startFormula() { - echo - echo "Starting $1 (using $2)..." - bash $2 -} - -stop_and_remove() { - check_docker_usage_possible - - container=$(docker ps -a | grep dock- | awk '{print $1}') - if [ -n "$container" ]; then - docker stop $container - docker rm $container - fi -} - - -# --- Main entry point ---------------------- -if [ $# -eq 0 ]; then - usage - exit 0 -fi - -# Parse comand-line options -while [ $# -gt 0 ]; do - case $1 in - -v | --version ) - version - exit 1 - ;; - -l | --list ) - list - exit - ;; - -u | --upgrade ) - upgrade - exit - ;; - -h | --help ) - usage - exit 1 - ;; - -c | --cat ) - dump $2 - exit - ;; - -d | --rm ) - stop_and_remove - exit - ;; - * ) # default case - start $1 - ;; - esac - shift -done diff --git a/dock/__init__.py b/dock/__init__.py new file mode 100644 index 0000000..65e8e48 --- /dev/null +++ b/dock/__init__.py @@ -0,0 +1,44 @@ +#!/usr/local/opt/python/bin/python2.7 + +import argparse + +import formula + + +def print_version(): + print('dock {} by Ben Ripkens and contributors'.format('2.0.2')) + print('https://github.com/bripkens/dock') + + +def main(): + parser = argparse.ArgumentParser(prog='dock', + usage='%(prog)s [options] [formula] [formula arguments...]', + description='easily bootstrap development tools with Docker') + parser.add_argument('formulas', + help='Execute the given formulas in the order in which they are defined on the command line.', + nargs='*') + parser.add_argument('-v', '--version', + action='store_true', + help='Display current script version') + parser.add_argument('-l', '--list', + action='store_true', + help='List available formulas') + parser.add_argument('--cleanup', + action='store_true', + help='Remove unused containers and images via docker-gc') + args = parser.parse_args() + + if args.version: + print_version() + elif args.cleanup: + formula.execute_formula('docker-gc', []) + elif args.list: + formula.list_available_formulas() + elif len(args.formulas) == 0: + parser.print_help() + else: + formula.execute_formula(args.formulas[0], args.formulas[1:]) + + +if __name__ == '__main__': + main() diff --git a/dock/docker.py b/dock/docker.py new file mode 100644 index 0000000..4de7567 --- /dev/null +++ b/dock/docker.py @@ -0,0 +1,160 @@ +import json +import os +import re +import subprocess +import time + +import formula + +devnull = open(os.devnull, 'w') + +def msg(k, v): + label = k + ':' if len(k) > 0 else '' + print(label.ljust(20, ' ') + v) + + +def add_name_prefix(container_name): + return 'dock-' + container_name + + +def force_stop(name): + name = add_name_prefix(name) + subprocess.call(['docker', 'stop', name], + stdout=devnull, + stderr=devnull) + subprocess.call(['docker', 'rm', name], + stdout=devnull, + stderr=devnull) + + +def is_container_running(name): + try: + output = subprocess.check_output(['docker', 'inspect', name], + stderr=devnull) + except Error: + return False + + return json.loads(output)[0]['State']['Running'] + + +def requires(dependent, dependency): + prefixed_dependency = add_name_prefix(dependency) + if not is_container_running(prefixed_dependency): + print('{} requires {} in order to run. Starting {}'.format(dependent, + dependency, + dependency)) + formula.execute_formula(dependency, []) + + +def run(image, + name, + publish=[], + auto_remove=False, + detach=True, + mount_docker_socket=False, + silent=False, + interactive=False, + link=[], + command=None, + entrypoint=None, + env={}, + volume={}): + name = add_name_prefix(name) + + args = ['docker', 'run', '--name', name] + + if detach: + args.append('--detach') + + if auto_remove: + args.append('--rm') + + if interactive: + args.extend(['--interactive', '--tty']) + + if not entrypoint == None: + args.extend(['--entrypoint', entrypoint]) + + if mount_docker_socket: + args.extend(['--volume', '/var/run/docker.sock:/var/run/docker.sock']) + + for key in volume: + args.extend(['--volume', '{}:{}'.format(key, volume[key])]) + + for publishedPort in publish: + args.extend(['--publish', '{}:{}'.format(publishedPort, publishedPort)]) + + for each_link in link: + args.extend(['--link', '{}:{}'.format(add_name_prefix(each_link[0]), + each_link[1])]) + + for key in env: + args.extend(['--env', '{}={}'.format(key, env[key])]) + + args.append(image) + + if not command == None: + args.extend(command) + + if not silent: + print('Starting image {} as container {}'.format(image, name)) + + result = subprocess.call(args) + if not result == 0: + print('Failed to start container.') + return + + if not silent: + # Docker cli can return before the new container can be inspected. This + # is very unfortunate. The following is a fragile solution which needs + # to be revisited in time. + time.sleep(0.5) + print_run_data(name) + + +def strip_protocol_from_port(port): + return re.search('^(\d+)', port).group(1) + + +def get_ip(): + try: + docker_machine_name = os.environ['DOCKER_MACHINE_NAME'] + return subprocess.check_output(['docker-machine', + 'ip', + docker_machine_name], + stderr=devnull).strip() + except KeyError: + pass + + try: + return subprocess.check_output(['boot2docker', 'ip'], + stderr=devnull) + except subprocess.CalledProcessError: + pass + + return '127.0.0.1' + + +def print_run_data(name): + output = subprocess.check_output(['docker', 'inspect', name]) + port_mappings = json.loads(output)[0]['NetworkSettings']['Ports'] + ports = port_mappings.keys() + ports.sort() + + msg('Container Name', name) + msg('IP', get_ip()) + + if len(ports) > 0: + msg('Ports', 'Host -> Container') + + for port in ports: + stripped_port = strip_protocol_from_port(port) + + host_ports = port_mappings[port] + # host ports may be None when the ports are not published + if host_ports == None: + continue + + for host_port in host_ports: + msg('', '{} -> {}'.format(host_port['HostPort'].ljust(5, ' '), + stripped_port)) diff --git a/dock/formula.py b/dock/formula.py new file mode 100644 index 0000000..2afc440 --- /dev/null +++ b/dock/formula.py @@ -0,0 +1,49 @@ +import importlib +import os.path +import re +import subprocess +import sys + + +HERE = os.path.abspath(os.path.dirname(__file__)) +FORMULA_DIR = os.path.join(HERE, 'formulas') + + +def list_available_formulas(): + print(':: Built-In Formulas') + for formula in sorted(os.listdir(FORMULA_DIR)): + if formula.endswith('.py') and not formula == '__init__.py': + match = re.search('([^.]+)\\.', formula) + print(match.group(1)) + + +def print_unknown_formula_contribution_hint(formula): + print('Unknown formula: {}'.format(formula)) + print('') + print('If you feel like {} should be supported by dock, please'.format(formula)) + print('consider opening an issue or sending a pull request to') + print('') + print(' https://github.com/bripkens/dock') + print('') + print('Thanks!') + + +def ensure_docker_usage_is_possible(): + returnCode = subprocess.call(['docker', 'ps'], stdout=open(os.devnull, 'w')) + if not returnCode == 0: + print('It seems like there are issues with your Docker setup.') + sys.exit(1) + + +def execute_formula(formula, formula_args): + ensure_docker_usage_is_possible() + module_name = 'formulas.' + formula + try: + mod = importlib.import_module(module_name) + path_to_module = os.path.join(FORMULA_DIR, formula + '.py') + mod.run(formula_args) + except ImportError as e: + if e.message.endswith(formula): + print_unknown_formula_contribution_hint(formula) + else: + raise diff --git a/dock/formulas/__init__.py b/dock/formulas/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/dock/formulas/artifactory.py b/dock/formulas/artifactory.py new file mode 100644 index 0000000..b749bf0 --- /dev/null +++ b/dock/formulas/artifactory.py @@ -0,0 +1,11 @@ +import docker + +container_name = 'artifactory' + +def run(args): + docker.force_stop(container_name) + docker.run(image='jfrog-docker-registry.bintray.io/jfrog/artifactory-oss', + name=container_name, + publish=[8081]) + docker.msg('Admin user', 'admin') + docker.msg('Admin password', 'password') diff --git a/dock/formulas/cassandra-cli.py b/dock/formulas/cassandra-cli.py new file mode 100644 index 0000000..1ddaed0 --- /dev/null +++ b/dock/formulas/cassandra-cli.py @@ -0,0 +1,11 @@ +import docker + +def run(args): + docker.run(image='cassandra:3.1.1', + name='cassandra-cli', + auto_remove=True, + detach=False, + interactive=True, + link=[['cassandra', 'cassandra']], + silent=True, + command=['sh', '-c', 'cqlsh -u cassandra -p cassandra "$CASSANDRA_PORT_9042_TCP_ADDR" "$CASSANDRA_PORT_9042_TCP_PORT"']) diff --git a/dock/formulas/cassandra.py b/dock/formulas/cassandra.py new file mode 100644 index 0000000..594b8c1 --- /dev/null +++ b/dock/formulas/cassandra.py @@ -0,0 +1,11 @@ +import docker + +container_name = 'cassandra' + +def run(args): + docker.force_stop(container_name) + docker.run(image='cassandra:3.1.1', + name=container_name, + publish=[7000, 7001, 7199, 9042, 9160]) + docker.msg('Root user', 'cassandra') + docker.msg('Root password', 'cassandra') diff --git a/dock/formulas/consul.py b/dock/formulas/consul.py new file mode 100644 index 0000000..9cd8d75 --- /dev/null +++ b/dock/formulas/consul.py @@ -0,0 +1,9 @@ +import docker + +container_name = 'consul' + +def run(args): + docker.force_stop(container_name) + docker.run(image='voxxit/consul:latest', + name=container_name, + publish=[8300, 8301, 8302, 8400, 8500, 8600]) diff --git a/dock/formulas/couchdb.py b/dock/formulas/couchdb.py new file mode 100644 index 0000000..428e784 --- /dev/null +++ b/dock/formulas/couchdb.py @@ -0,0 +1,13 @@ +import docker + +container_name = 'couchdb' + +def run(args): + docker.force_stop(container_name) + docker.run(image='klaemo/couchdb:1.6.1', + name=container_name, + publish=[5984]) + # Define username and password via environment vars once + # https://github.com/klaemo/docker-couchdb/issues/43 + # has been resolved. + #docker.msg('Authentication', 'See auth information in docker logs dock-couchdb') diff --git a/dock/formulas/docker-gc.py b/dock/formulas/docker-gc.py new file mode 100644 index 0000000..d7ac09b --- /dev/null +++ b/dock/formulas/docker-gc.py @@ -0,0 +1,9 @@ +import docker + +def run(args): + docker.run(image='spotify/docker-gc', + name='docker-gc', + auto_remove=True, + detach=False, + mount_docker_socket=True, + silent=True) diff --git a/dock/formulas/elasticsearch.py b/dock/formulas/elasticsearch.py new file mode 100644 index 0000000..416d857 --- /dev/null +++ b/dock/formulas/elasticsearch.py @@ -0,0 +1,9 @@ +import docker + +container_name = 'elasticsearch' + +def run(args): + docker.force_stop(container_name) + docker.run(image='elasticsearch:2.1.1', + name=container_name, + publish=[9200, 9300]) diff --git a/dock/formulas/jenkins.py b/dock/formulas/jenkins.py new file mode 100644 index 0000000..9255968 --- /dev/null +++ b/dock/formulas/jenkins.py @@ -0,0 +1,9 @@ +import docker + +container_name = 'jenkins' + +def run(args): + docker.force_stop(container_name) + docker.run(image='jenkins', + name=container_name, + publish=[8080, 50000]) diff --git a/dock/formulas/kafka-cli.py b/dock/formulas/kafka-cli.py new file mode 100644 index 0000000..90644c0 --- /dev/null +++ b/dock/formulas/kafka-cli.py @@ -0,0 +1,15 @@ +import docker + +def run(args): + print('Starting an interactive Docker container which contains the') + print('Kafka CLI tools. Inspect the env to learn about IPs and ports.') + print('Kafka is located at $KAFKA_HOME.') + + docker.run(image='ches/kafka:0.8.2.1', + name='kafka-cli', + auto_remove=True, + detach=False, + interactive=True, + link=[['kafka', 'kafka']], + silent=True, + command=['bash']) diff --git a/dock/formulas/kafka.py b/dock/formulas/kafka.py new file mode 100644 index 0000000..f95c30d --- /dev/null +++ b/dock/formulas/kafka.py @@ -0,0 +1,14 @@ +import docker + +container_name = 'kafka' + +def run(args): + docker.force_stop(container_name) + docker.requires(dependent=container_name, dependency='zookeeper') + docker.run(image='ches/kafka:0.8.2.1', + name=container_name, + link=[['zookeeper', 'zookeeper']], + env={ + 'KAFKA_ADVERTISED_HOST_NAME': docker.get_ip() + }, + publish=[7203, 9092]) diff --git a/dock/formulas/memcached.py b/dock/formulas/memcached.py new file mode 100644 index 0000000..32141ff --- /dev/null +++ b/dock/formulas/memcached.py @@ -0,0 +1,9 @@ +import docker + +container_name = 'memcached' + +def run(args): + docker.force_stop(container_name) + docker.run(image='memcached:1.4.25', + name=container_name, + publish=[11211]) diff --git a/dock/formulas/mongo-express.py b/dock/formulas/mongo-express.py new file mode 100644 index 0000000..da60419 --- /dev/null +++ b/dock/formulas/mongo-express.py @@ -0,0 +1,11 @@ +import docker + +container_name = 'mongo-express' + +def run(args): + docker.force_stop(container_name) + docker.requires(dependent=container_name, dependency='mongodb') + docker.run(image='knickers/mongo-express:0.29.3', + name=container_name, + link=[['mongodb', 'mongo']], + publish=[8081]) diff --git a/dock/formulas/mongodb.py b/dock/formulas/mongodb.py new file mode 100644 index 0000000..4ad1a9b --- /dev/null +++ b/dock/formulas/mongodb.py @@ -0,0 +1,9 @@ +import docker + +container_name = 'mongodb' + +def run(args): + docker.force_stop(container_name) + docker.run(image='mongo:3.2.0', + name=container_name, + publish=[27017, 27018]) diff --git a/dock/formulas/mysql-cli.py b/dock/formulas/mysql-cli.py new file mode 100644 index 0000000..30ba9eb --- /dev/null +++ b/dock/formulas/mysql-cli.py @@ -0,0 +1,11 @@ +import docker + +def run(args): + docker.run(image='mysql:5.7.10', + name='mysql-cli', + auto_remove=True, + detach=False, + interactive=True, + link=[['mysql', 'mysql']], + silent=True, + command=['sh', '-c', 'mysql -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -uroot -proot']) diff --git a/dock/formulas/mysql.py b/dock/formulas/mysql.py new file mode 100644 index 0000000..98a0d49 --- /dev/null +++ b/dock/formulas/mysql.py @@ -0,0 +1,25 @@ +import docker + +container_name = 'mysql' + +root_password = 'root' +database = 'dock-db' +user = 'user' +password = 'user' + +def run(args): + docker.force_stop(container_name) + docker.run(image='mysql:5.7.10', + name=container_name, + publish=[3306], + env={ + 'MYSQL_ROOT_PASSWORD': root_password, + 'MYSQL_DATABASE': database, + 'MYSQL_USER': user, + 'MYSQL_PASSWORD': password + }) + + docker.msg('Root password', root_password) + docker.msg('Database', database) + docker.msg('User name', user) + docker.msg('User password', password) diff --git a/dock/formulas/neo4j.py b/dock/formulas/neo4j.py new file mode 100644 index 0000000..44dc11d --- /dev/null +++ b/dock/formulas/neo4j.py @@ -0,0 +1,11 @@ +import docker + +container_name = 'neo4j' + +def run(args): + docker.force_stop(container_name) + docker.run(image='neo4j:2.3.1', + name=container_name, + publish=[7474], + env={'NEO4J_AUTH': 'none'}) + docker.msg('Authentication', 'Disabled') diff --git a/dock/formulas/nexus.py b/dock/formulas/nexus.py new file mode 100644 index 0000000..a4e45f4 --- /dev/null +++ b/dock/formulas/nexus.py @@ -0,0 +1,11 @@ +import docker + +container_name = 'nexus' + +def run(args): + docker.force_stop(container_name) + docker.run(image='sonatype/nexus:latest', + name=container_name, + publish=[8081]) + docker.msg('Admin user', 'admin') + docker.msg('Admin password', 'admin123') diff --git a/dock/formulas/node-4.py b/dock/formulas/node-4.py new file mode 100644 index 0000000..72189e5 --- /dev/null +++ b/dock/formulas/node-4.py @@ -0,0 +1,10 @@ +import docker + +def run(args): + docker.run(image='node:4', + name='node-4', + auto_remove=True, + detach=False, + interactive=True, + silent=True, + command=['bash']) diff --git a/dock/formulas/node-5.py b/dock/formulas/node-5.py new file mode 100644 index 0000000..dd10187 --- /dev/null +++ b/dock/formulas/node-5.py @@ -0,0 +1,10 @@ +import docker + +def run(args): + docker.run(image='node:5', + name='node-5', + auto_remove=True, + detach=False, + interactive=True, + silent=True, + command=['bash']) diff --git a/dock/formulas/orientdb.py b/dock/formulas/orientdb.py new file mode 100644 index 0000000..7adc0b7 --- /dev/null +++ b/dock/formulas/orientdb.py @@ -0,0 +1,21 @@ +import docker + +# see +# https://github.com/orientechnologies/docker-docs/blob/master/orientdb/content.md +# https://github.com/orientechnologies/orientdb-docker/issues/4 +# https://hub.docker.com/r/orientdb/orientdb/~/dockerfile/ + +container_name = 'orientdb' + +password = 'root' + +def run(args): + docker.force_stop(container_name) + docker.run(image='orientdb/orientdb:2.1.5', + name=container_name, + publish=[2424, 2480], + env={ + 'ORIENTDB_ROOT_PASSWORD': password + }) + + docker.msg('Root password', password) diff --git a/dock/formulas/php5-apache.py b/dock/formulas/php5-apache.py new file mode 100644 index 0000000..fbe7066 --- /dev/null +++ b/dock/formulas/php5-apache.py @@ -0,0 +1,15 @@ +import docker +import os + +cwd = os.getcwd() +container_name = 'php5-apache' + +def run(args): + docker.force_stop(container_name) + docker.run(image='php:5-apache', + name=container_name, + volume={ + os.getcwd(): '/var/www/html' + }, + publish=[80]) + docker.msg('Volume', '{} mounted to /var/www/html'.format(os.getcwd())) diff --git a/dock/formulas/php5-fpm.py b/dock/formulas/php5-fpm.py new file mode 100644 index 0000000..cd190ce --- /dev/null +++ b/dock/formulas/php5-fpm.py @@ -0,0 +1,15 @@ +import docker +import os + +cwd = os.getcwd() +container_name = 'php5-fpm' + +def run(args): + docker.force_stop(container_name) + docker.run(image='php:5-fpm', + name=container_name, + volume={ + os.getcwd(): '/var/www/html' + }, + publish=[9000]) + docker.msg('Volume', '{} mounted to /var/www/html'.format(os.getcwd())) diff --git a/dock/formulas/php7-apache.py b/dock/formulas/php7-apache.py new file mode 100644 index 0000000..498b0ac --- /dev/null +++ b/dock/formulas/php7-apache.py @@ -0,0 +1,15 @@ +import docker +import os + +cwd = os.getcwd() +container_name = 'php7-apache' + +def run(args): + docker.force_stop(container_name) + docker.run(image='php:7-apache', + name=container_name, + volume={ + os.getcwd(): '/var/www/html' + }, + publish=[80]) + docker.msg('Volume', '{} mounted to /var/www/html'.format(os.getcwd())) diff --git a/dock/formulas/php7-fpm.py b/dock/formulas/php7-fpm.py new file mode 100644 index 0000000..3fbf756 --- /dev/null +++ b/dock/formulas/php7-fpm.py @@ -0,0 +1,15 @@ +import docker +import os + +cwd = os.getcwd() +container_name = 'php7-fpm' + +def run(args): + docker.force_stop(container_name) + docker.run(image='php:7-fpm', + name=container_name, + volume={ + os.getcwd(): '/var/www/html' + }, + publish=[9000]) + docker.msg('Volume', '{} mounted to /var/www/html'.format(os.getcwd())) diff --git a/dock/formulas/postgres-cli.py b/dock/formulas/postgres-cli.py new file mode 100644 index 0000000..26c6fb9 --- /dev/null +++ b/dock/formulas/postgres-cli.py @@ -0,0 +1,11 @@ +import docker + +def run(args): + docker.run(image='postgres:9.5.0', + name='postgres-cli', + auto_remove=True, + detach=False, + interactive=True, + link=[['postgres', 'postgres']], + silent=True, + command=['sh', '-c', 'psql -h "$POSTGRES_PORT_5432_TCP_ADDR" -p "$POSTGRES_PORT_5432_TCP_PORT" -U admin']) diff --git a/dock/formulas/postgres.py b/dock/formulas/postgres.py new file mode 100644 index 0000000..2261820 --- /dev/null +++ b/dock/formulas/postgres.py @@ -0,0 +1,19 @@ +import docker + +container_name = 'postgres' + +user = 'admin' +password = 'admin' + +def run(args): + docker.force_stop(container_name) + docker.run(image='postgres:9.5.0', + name=container_name, + publish=[5432], + env={ + 'POSTGRES_USER': user, + 'POSTGRES_PASSWORD': password + }) + + docker.msg('Admin user', user) + docker.msg('Admin password', password) diff --git a/dock/formulas/rabbitmq.py b/dock/formulas/rabbitmq.py new file mode 100644 index 0000000..a7f9851 --- /dev/null +++ b/dock/formulas/rabbitmq.py @@ -0,0 +1,19 @@ +import docker + +container_name = 'rabbitmq' + +user = 'admin' +password = 'admin' + +def run(args): + docker.force_stop(container_name) + docker.run(image='rabbitmq:3.6.0-management', + name=container_name, + publish=[4369, 5671, 5672, 15671, 15672, 25672], + env={ + 'RABBITMQ_DEFAULT_USER': user, + 'RABBITMQ_DEFAULT_PASS': password + }) + docker.msg('Admin user', user) + docker.msg('Admin password', password) + docker.msg('Management Console', 'http://{}:15672'.format(docker.get_ip())) diff --git a/dock/formulas/redis-cli.py b/dock/formulas/redis-cli.py new file mode 100644 index 0000000..1835840 --- /dev/null +++ b/dock/formulas/redis-cli.py @@ -0,0 +1,11 @@ +import docker + +def run(args): + docker.run(image='redis:3.0.6', + name='redis-cli', + auto_remove=True, + detach=False, + interactive=True, + link=[['redis', 'redis']], + silent=True, + command=['sh', '-c', 'redis-cli -h "$REDIS_PORT_6379_TCP_ADDR" -p "$REDIS_PORT_6379_TCP_PORT"']) diff --git a/dock/formulas/redis.py b/dock/formulas/redis.py new file mode 100644 index 0000000..a0eb51e --- /dev/null +++ b/dock/formulas/redis.py @@ -0,0 +1,9 @@ +import docker + +container_name = 'redis' + +def run(args): + docker.force_stop(container_name) + docker.run(image='redis:3.0.6', + name=container_name, + publish=[6379]) diff --git a/dock/formulas/rethinkdb.py b/dock/formulas/rethinkdb.py new file mode 100644 index 0000000..a78e7d4 --- /dev/null +++ b/dock/formulas/rethinkdb.py @@ -0,0 +1,11 @@ +import docker + +container_name = 'rethinkdb' + +def run(args): + docker.force_stop(container_name) + docker.run(image='rethinkdb:2.2.2', + name=container_name, + publish=[8080, 28015, 29015]) + + docker.msg('Admin Interface', 'http://{}:8080'.format(docker.get_ip())) diff --git a/dock/formulas/sonarqube.py b/dock/formulas/sonarqube.py new file mode 100644 index 0000000..0f555c6 --- /dev/null +++ b/dock/formulas/sonarqube.py @@ -0,0 +1,11 @@ +import docker + +container_name = 'sonarqube' + +def run(args): + docker.force_stop(container_name) + docker.run(image='sonarqube:5.2', + name=container_name, + publish=[9000]) + docker.msg('Admin user', 'admin') + docker.msg('Admin password', 'admin') diff --git a/dock/formulas/ubuntu.py b/dock/formulas/ubuntu.py new file mode 100644 index 0000000..239d85b --- /dev/null +++ b/dock/formulas/ubuntu.py @@ -0,0 +1,10 @@ +import docker + +def run(args): + docker.run(image='ubuntu:14.04', + name='ubuntu', + auto_remove=True, + detach=False, + interactive=True, + silent=True, + command=['bash']) diff --git a/dock/formulas/zookeeper-cli.py b/dock/formulas/zookeeper-cli.py new file mode 100644 index 0000000..1dcb855 --- /dev/null +++ b/dock/formulas/zookeeper-cli.py @@ -0,0 +1,12 @@ +import docker + +def run(args): + docker.run(image='jplock/zookeeper:3.4.7', + name='zookeeper-cli', + auto_remove=True, + detach=False, + interactive=True, + link=[['zookeeper', 'zookeeper']], + silent=True, + entrypoint='sh', + command=['-c', './bin/zkCli.sh -server "$ZOOKEEPER_PORT_2181_TCP_ADDR":"$ZOOKEEPER_PORT_2181_TCP_PORT"']) diff --git a/dock/formulas/zookeeper.py b/dock/formulas/zookeeper.py new file mode 100644 index 0000000..03d1993 --- /dev/null +++ b/dock/formulas/zookeeper.py @@ -0,0 +1,9 @@ +import docker + +container_name = 'zookeeper' + +def run(args): + docker.force_stop(container_name) + docker.run(image='jplock/zookeeper:3.4.7', + name=container_name, + publish=[2181, 2888, 3888]) diff --git a/formulas/activemq b/formulas/activemq deleted file mode 100644 index 7afb913..0000000 --- a/formulas/activemq +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -source "${BASH_SOURCE%/*}/../common" - -force_stop dock-activemq - -run --detach \ - --publish 8161:8161 \ - --publish 61612:61612 \ - --publish 61613:61613 \ - --publish 61616:61616 \ - --name dock-activemq \ - aterreno/activemq-dockerfile - -echo "Admin user: admin" -echo "Admin pw: admin" diff --git a/formulas/apacheds b/formulas/apacheds deleted file mode 100644 index 1728f34..0000000 --- a/formulas/apacheds +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -source "${BASH_SOURCE%/*}/../common" - -force_stop dock-apacheds - -run --detach \ - --publish 10389:10389 \ - --name dock-apacheds \ - jjhughes57/apacheds-docker - -echo "Admin user: uid=admin,ou=system" -echo "Admin pw: secret" diff --git a/formulas/artifactory b/formulas/artifactory deleted file mode 100644 index c967e05..0000000 --- a/formulas/artifactory +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -source "${BASH_SOURCE%/*}/../common" - -force_stop dock-artifactory - -run --detach \ - --publish 8473:8081 \ - --name dock-artifactory \ - jfrog-docker-registry.bintray.io/jfrog/artifactory-oss diff --git a/formulas/cachet b/formulas/cachet deleted file mode 100644 index 2816052..0000000 --- a/formulas/cachet +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -source "${BASH_SOURCE%/*}/../common" - -force_stop dock-cachet-mysql -force_stop dock-cachet - -root_pw="root" -db="dockDatabase" -user="dockUser" -user_pw="dockPassword" - -run --detach \ - --env MYSQL_ROOT_PASSWORD=$root_pw \ - --env MYSQL_USER=$user \ - --env MYSQL_PASSWORD=$user_pw \ - --env MYSQL_DATABASE=$db \ - --name dock-cachet-mysql \ - mysql - -echo "Root password: $root_pw" -echo -echo "Database: $db" -echo "User: $user" -echo "User password: $user_pw" - -run --detach \ - --link dock-cachet-mysql:mysql \ - --env DB_HOST=mysql \ - --env DB_DATABASE=$db \ - --env DB_USERNAME=$user \ - --env DB_PASSWORD=$user_pw \ - --publish 8585:8000 \ - --name dock-cachet \ - cachethq/docker:latest - -sleep 5 -docker exec dock-cachet php artisan migrate --force -docker exec dock-cachet php artisan key:generate -docker exec dock-cachet php artisan config:cache - -echo "Cache started. You can now access it via:" -echo " http://192.168.59.103:8585/setup" diff --git a/formulas/cassandra b/formulas/cassandra deleted file mode 100644 index 950616f..0000000 --- a/formulas/cassandra +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -source "${BASH_SOURCE%/*}/../common" - -force_stop dock-cassandra - -run --detach \ - --publish 7000:7000 \ - --publish 7001:7001 \ - --publish 7199:7199 \ - --publish 9042:9042 \ - --publish 9160:9160 \ - --name dock-cassandra \ - abh1nav/cassandra - -echo "Pro Tip: You can use Cassandra's CQLSH via 'dock cassandra-cqlsh'." diff --git a/formulas/cassandra-cqlsh b/formulas/cassandra-cqlsh deleted file mode 100644 index 0e5f557..0000000 --- a/formulas/cassandra-cqlsh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -docker run --interactive \ - --tty \ - --rm \ - --link dock-cassandra:cassandra \ - relateiq/cassandra \ - bash -c 'exec /opt/cassandra/bin/cqlsh "$CASSANDRA_PORT_9160_TCP_ADDR" "$CASSANDRA_PORT_9160_TCP_PORT"' diff --git a/formulas/couchdb b/formulas/couchdb deleted file mode 100644 index ca117b0..0000000 --- a/formulas/couchdb +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -source "${BASH_SOURCE%/*}/../common" - -force_stop dock-couchdb - -run --detach \ - --publish 5984:5984 \ - --name dock-couchdb \ - klaemo/couchdb:latest diff --git a/formulas/couchdb-ssl b/formulas/couchdb-ssl deleted file mode 100644 index 9f8cada..0000000 --- a/formulas/couchdb-ssl +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -source "${BASH_SOURCE%/*}/../common" - -force_stop dock-couchdb-ssl - -run --detach \ - --publish 6984:6984 \ - --name dock-couchdb-ssl \ - klaemo/couchdb-ssl:latest - -echo 'Note: CouchDB is only accepting https connections on port 6984.' -echo ' Make sure to accept self-signed and unverified, i.e.' -echo ' insecure, connections.' -echo ' Example: curl -k https://$DOCKER_IP:6984' diff --git a/formulas/docker-gc b/formulas/docker-gc deleted file mode 100644 index 0a72903..0000000 --- a/formulas/docker-gc +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -docker run --rm \ - --volume /var/run/docker.sock:/var/run/docker.sock \ - spotify/docker-gc diff --git a/formulas/elasticsearch b/formulas/elasticsearch deleted file mode 100644 index bafc77a..0000000 --- a/formulas/elasticsearch +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -source "${BASH_SOURCE%/*}/../common" - -force_stop dock-elasticsearch - -run --detach \ - --publish 9200:9200 \ - --publish 9300:9300 \ - --name dock-elasticsearch \ - elasticsearch diff --git a/formulas/jenkins b/formulas/jenkins deleted file mode 100644 index 34bc06c..0000000 --- a/formulas/jenkins +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -source "${BASH_SOURCE%/*}/../common" - -force_stop dock-jenkins - -run --detach \ - --publish 8472:8080 \ - --name dock-jenkins \ - jenkins diff --git a/formulas/kafka b/formulas/kafka deleted file mode 100644 index a29d2bd..0000000 --- a/formulas/kafka +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -# This setup is based on the following GitHub repository and fig file -# https://github.com/wurstmeister/kafka-docker - -source "${BASH_SOURCE%/*}/../common" - -if [ -z "$(docker ps | grep dock-zookeeper)" ]; then - echo "Zookeeper hasn't beed started, but is required by Kafka." - dock zookeeper -fi - -echo -echo "Starting three Kafka instances..." - -for i in {1..3}; do - echo - - force_stop "dock-kafka-$i" - - run --detach \ - --publish "909$(($i + 1)):9092" \ - --env "KAFKA_ADVERTISED_HOST_NAME=192.168.59.103" \ - --volume "/var/run/docker.sock:/var/run/docker.sock" \ - --link dock-zookeeper:zk \ - --name "dock-kafka-$i" \ - wurstmeister/kafka:0.8.1.1-1 -done diff --git a/formulas/kafka-cli b/formulas/kafka-cli deleted file mode 100644 index 7e42d1d..0000000 --- a/formulas/kafka-cli +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -echo ' -# Starting an interactive Docker container which contains the -# CLI tools. Inspect the env to learn about IPs and ports. -# Kafka is located at $KAFKA_HOME.' - -docker run --interactive \ - --tty \ - --link dock-zookeeper:zk \ - --link dock-kafka-1:kafka-1 \ - --link dock-kafka-2:kafka-2 \ - --link dock-kafka-3:kafka-3 \ - wurstmeister/kafka:0.8.1.1-1 \ - bash diff --git a/formulas/memcached b/formulas/memcached deleted file mode 100644 index 16c98dd..0000000 --- a/formulas/memcached +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -source "${BASH_SOURCE%/*}/../common" - -force_stop dock-memcached - -run --detach \ - --publish 11211:11211 \ - --name dock-memcached \ - memcached diff --git a/formulas/mongodb b/formulas/mongodb deleted file mode 100644 index 3b754a9..0000000 --- a/formulas/mongodb +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -source "${BASH_SOURCE%/*}/../common" - -force_stop dock-mongodb - -run --detach \ - --publish 27017:27017 \ - --publish 27018:27018 \ - --name dock-mongodb \ - mongo diff --git a/formulas/mysql b/formulas/mysql deleted file mode 100644 index 6014a92..0000000 --- a/formulas/mysql +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -source "${BASH_SOURCE%/*}/../common" - -force_stop dock-mysql - -root_pw="root" -db="dockDatabase" -user="dockUser" -user_pw="dockPassword" - -run --detach \ - --env MYSQL_ROOT_PASSWORD=$root_pw \ - --env MYSQL_USER=$user \ - --env MYSQL_PASSWORD=$user_pw \ - --env MYSQL_DATABASE=$db \ - --publish 3306:3306 \ - --name dock-mysql \ - mysql - -echo "Root password: $root_pw" -echo -echo "Database: $db" -echo "User: $user" -echo "User password: $user_pw" diff --git a/formulas/mysql-cli b/formulas/mysql-cli deleted file mode 100644 index 96f81ef..0000000 --- a/formulas/mysql-cli +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -docker run --interactive \ - --tty \ - --rm \ - --link dock-mysql:mysql \ - mysql \ - sh -c 'exec mysql -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -uroot -p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD"' diff --git a/formulas/neo4j b/formulas/neo4j deleted file mode 100644 index ce0ee00..0000000 --- a/formulas/neo4j +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -source "${BASH_SOURCE%/*}/../common" - -force_stop dock-neo4j - -run --detach \ - --publish 7474:7474 \ - --name dock-neo4j \ - neo4j/neo4j diff --git a/formulas/nexus b/formulas/nexus deleted file mode 100644 index 3924d04..0000000 --- a/formulas/nexus +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -# more about configuring nexus -# http://books.sonatype.com/nexus-book/2.10/reference/npm-configuring.html -# -# original cudos to Marcello de Sales: -# https://registry.hub.docker.com/u/marcellodesales/nexus-npm-registry/ - -source "${BASH_SOURCE%/*}/../common" - -force_stop dock-nexus - -run --detach \ - --publish 8081:8081 \ - --name dock-nexus \ - marcellodesales/nexus-npm-registry - -echo "Admin user: admin" -echo "Admin pw: admin123" diff --git a/formulas/node b/formulas/node deleted file mode 100644 index c335838..0000000 --- a/formulas/node +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -docker run --interactive \ - --tty \ - --rm \ - node \ - node diff --git a/formulas/orientdb b/formulas/orientdb deleted file mode 100644 index 914c0cd..0000000 --- a/formulas/orientdb +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -source "${BASH_SOURCE%/*}/../common" - -force_stop dock-orientdb - -run --detach \ - --publish 2424:2424 \ - --publish 2480:2480 \ - --name dock-orientdb \ - joaodubas/orientdb - -echo "Admin user: admin" -echo "Admin pw: admin" diff --git a/formulas/php5-apache b/formulas/php5-apache deleted file mode 100644 index 8a8778e..0000000 --- a/formulas/php5-apache +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -source "${BASH_SOURCE%/*}/../common" - -force_stop dock-php5-apache - -run --detach \ - --publish 80 \ - --name dock-php5-apache \ - --volume $(pwd):/var/www/html \ - php:5-apache - -echo "Mounted $(pwd) into /var/www/html" diff --git a/formulas/php5-fpm b/formulas/php5-fpm deleted file mode 100644 index 90d58c2..0000000 --- a/formulas/php5-fpm +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -source "${BASH_SOURCE%/*}/../common" - -force_stop dock-php5-fpm - -run --detach \ - --publish 9000 \ - --name dock-php5-fpm \ - --volume $(pwd):/var/www/html \ - php:5-fpm - -echo "Mounted $(pwd) into /var/www/html" diff --git a/formulas/php7-apache b/formulas/php7-apache deleted file mode 100644 index ea410a5..0000000 --- a/formulas/php7-apache +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -source "${BASH_SOURCE%/*}/../common" - -force_stop dock-php7-apache - -run --detach \ - --publish 80 \ - --name dock-php7-apache \ - --volume $(pwd):/var/www/html \ - php:7-apache - -echo "Mounted $(pwd) into /var/www/html" diff --git a/formulas/php7-fpm b/formulas/php7-fpm deleted file mode 100644 index 94ac56b..0000000 --- a/formulas/php7-fpm +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -source "${BASH_SOURCE%/*}/../common" - -force_stop dock-php7-fpm - -run --detach \ - --publish 9000 \ - --name dock-php7-fpm \ - --volume $(pwd):/var/www/html \ - php:7-fpm - -echo "Mounted $(pwd) into /var/www/html" diff --git a/formulas/postgres b/formulas/postgres deleted file mode 100644 index 92410cf..0000000 --- a/formulas/postgres +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -source "${BASH_SOURCE%/*}/../common" - -force_stop dock-postgres - -run --detach \ - --name dock-postgres \ - --publish 5432:5432 \ - postgres - -echo "Default User: postgres" -echo "Pro Tip: You can use the postgres CLI via 'dock postgres-cli'." diff --git a/formulas/postgres-cli b/formulas/postgres-cli deleted file mode 100644 index 5413e2f..0000000 --- a/formulas/postgres-cli +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -docker run --interactive \ - --tty \ - --rm \ - --link dock-postgres:postgres \ - postgres \ - bash -c 'exec psql -h "$POSTGRES_PORT_5432_TCP_ADDR" -p "$POSTGRES_PORT_5432_TCP_PORT" -U postgres' diff --git a/formulas/rabbitmq b/formulas/rabbitmq deleted file mode 100644 index b5474b3..0000000 --- a/formulas/rabbitmq +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -source "${BASH_SOURCE%/*}/../common" - -force_stop dock-rabbitmq - -run --detach \ - --name dock-rabbitmq \ - --publish 5672:5672 \ - --publish 15672:15672 \ - tutum/rabbitmq - -echo "Admin user: admin" -echo "Admin password: Inspect the password via 'docker logs dock-rabbitmq'" diff --git a/formulas/redis b/formulas/redis deleted file mode 100644 index 8742b92..0000000 --- a/formulas/redis +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -source "${BASH_SOURCE%/*}/../common" - -force_stop dock-redis - -run --detach \ - --name dock-redis \ - --publish 6379:6379 \ - redis diff --git a/formulas/redis-cli b/formulas/redis-cli deleted file mode 100644 index c1bda02..0000000 --- a/formulas/redis-cli +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -docker run --interactive \ - --tty \ - --rm \ - --link dock-redis:redis \ - redis \ - bash -c 'redis-cli -h $REDIS_PORT_6379_TCP_ADDR' diff --git a/formulas/rethinkdb b/formulas/rethinkdb deleted file mode 100644 index bebb6fa..0000000 --- a/formulas/rethinkdb +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -source "${BASH_SOURCE%/*}/../common" - -force_stop dock-rethinkdb - -run --detach \ - --publish 8080:8080 \ - --publish 28015:28015 \ - --publish 29015:29015 \ - --name dock-rethinkdb \ - shipyard/rethinkdb diff --git a/formulas/sonar b/formulas/sonar deleted file mode 100644 index 8caae5f..0000000 --- a/formulas/sonar +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -source "${BASH_SOURCE%/*}/../common" - -force_stop dock-sonar-server -force_stop dock-sonar-mysql - -run --detach \ - --publish 3306:3306 \ - --name dock-sonar-mysql \ - tpires/sonar-mysql - -echo -run --detach \ - --publish 8474:9000 \ - --name dock-sonar-server \ - --link dock-sonar-mysql:db \ - tpires/sonar-server - -echo "Admin user: admin" -echo "Admin pw: admin" diff --git a/formulas/ubuntu b/formulas/ubuntu deleted file mode 100644 index 0e5a533..0000000 --- a/formulas/ubuntu +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -docker run --interactive \ - --tty \ - --rm \ - ubuntu \ - bash diff --git a/formulas/wordpress b/formulas/wordpress deleted file mode 100644 index 65ff238..0000000 --- a/formulas/wordpress +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -source "${BASH_SOURCE%/*}/../common" - -if [ -z "$(docker ps | grep dock-mysql)" ]; then - echo "MySQL hasn't beed started, but is required by Wordpress." - dock mysql -fi - -force_stop dock-wordpress - -run --detach \ - --publish 8686:80 \ - --name dock-wordpress \ - --link dock-mysql:mysql \ - wordpress:latest - -echo "Wordpress Database name: wordpress" -echo "Wordpress Database user: root" diff --git a/formulas/zookeeper b/formulas/zookeeper deleted file mode 100644 index 649fcfa..0000000 --- a/formulas/zookeeper +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -source "${BASH_SOURCE%/*}/../common" - -force_stop dock-zookeeper - -run --detach \ - --publish 2181:2181 \ - --publish 2888:2888 \ - --publish 3888:3888 \ - --name dock-zookeeper \ - jplock/zookeeper:3.4.6 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..3c6e79c --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..a888a88 --- /dev/null +++ b/setup.py @@ -0,0 +1,97 @@ +from setuptools import setup, find_packages +from codecs import open +from os import path + +HERE = path.abspath(path.dirname(__file__)) + +# Get the long description from the README file +with open(path.join(HERE, 'README.md'), encoding='utf-8') as f: + LONG_DESCRIPTION = f.read() + +setup( + name='dock-upload-test', + + version='2.0.2', + + description='Bootstrap databases, MOMs and other tools that you need for development purposes', + long_description=LONG_DESCRIPTION, + + url='https://github.com/bripkens/dock', + + author='Ben Ripkens', + author_email='bripkens@gmail.com', + + license='MIT', + + # See https://pypi.python.org/pypi?%3Aaction=list_classifiers + classifiers=[ + # How mature is this project? Common values are + # 3 - Alpha + # 4 - Beta + # 5 - Production/Stable + 'Development Status :: 4 - Beta', + + # Indicate who your project is intended for + 'Intended Audience :: Developers', + 'Topic :: Software Development', + + # Pick your license as you wish (should match "license" above) + 'License :: OSI Approved :: MIT License', + + # Specify the Python versions you support here. In particular, ensure + # that you indicate whether you support Python 2, Python 3 or both. + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.2', + 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5' + ], + + keywords='development databases bootstrap setup messaging', + + # You can just specify the packages manually here if your project is + # simple. Or you can use find_packages(). + packages=find_packages(exclude=['contrib', 'docs', 'tests']), + + # Alternatively, if you want to distribute just a my_module.py, uncomment + # this: + # py_modules=["my_module"], + + # List run-time dependencies here. These will be installed by pip when + # your project is installed. For an analysis of "install_requires" vs pip's + # requirements files see: + # https://packaging.python.org/en/latest/requirements.html + install_requires=[], + + # List additional groups of dependencies here (e.g. development + # dependencies). You can install these using the following syntax, + # for example: + # $ pip install -e .[dev,test] + extras_require={ + 'dev': ['check-manifest'], + 'test': ['coverage'] + }, + + # If there are data files included in your packages that need to be + # installed, specify them here. If using Python 2.6 or less, then these + # have to be included in MANIFEST.in as well. + package_data={}, + + # Although 'package_data' is the preferred approach, in some case you may + # need to place data files outside of your packages. See: + # http://docs.python.org/3.4/distutils/setupscript.html#installing-additional-files # noqa + # In this case, 'data_file' will be installed into '/my_data' + data_files=[], + + # To provide executable scripts, use entry points in preference to the + # "scripts" keyword. Entry points provide cross-platform support and allow + # pip to create the appropriate form of executable for the target platform. + entry_points={ + 'console_scripts': [ + 'dock=dock:main' + ] + }, +)