Docker starter for Cloud 66
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
common formatting + fixes in Dockerfile after moving the github org Sep 4, 2018
definitions formatting + fixes in Dockerfile after moving the github org Sep 4, 2018
packs formatting + fixes in Dockerfile after moving the github org Sep 4, 2018
templates Feature/service to kubes (#64) Jul 31, 2017
test remove test files Jul 12, 2018
transform formatting + fixes in Dockerfile after moving the github org Sep 4, 2018
vendor org move + vendoring with go dep Jul 12, 2018
.gitignore support for docker-compose to service.yml and new installer (#62) Jul 10, 2017
CHANGELOG.md bump version Jul 31, 2017
Dockerfile formatting + fixes in Dockerfile after moving the github org Sep 4, 2018
Dockerfile.crosscompile formatting + fixes in Dockerfile after moving the github org Sep 4, 2018
Dockerfile.production try update version for hang in staging Jul 26, 2017
Gopkg.lock formatting + fixes in Dockerfile after moving the github org Sep 4, 2018
Gopkg.toml org move + vendoring with go dep Jul 12, 2018
LICENSE support for docker-compose to service.yml and new installer (#62) Jul 10, 2017
README.md org move + vendoring with go dep Jul 12, 2018
api.go formatting + fixes in Dockerfile after moving the github org Sep 4, 2018
api_test.go Feature/service to kubes (#64) Jul 31, 2017
build.yml org move + vendoring with go dep Jul 12, 2018
cli_test.go all test green (#40) Nov 22, 2016
codeship-services.yml adding service and steps yml to run on codeship Mar 7, 2016
codeship-steps.yml all test green (#40) Nov 22, 2016
compile.sh new compile Aug 1, 2017
config.go hardcode default node versions Sep 22, 2016
detect.go formatting + fixes in Dockerfile after moving the github org Sep 4, 2018
docker-compose.yml all test green (#40) Nov 22, 2016
install.sh org move + vendoring with go dep Jul 12, 2018
main.go formatting + fixes in Dockerfile after moving the github org Sep 4, 2018
output_test.go formatting + fixes in Dockerfile after moving the github org Sep 4, 2018
service.yml all test green (#40) Nov 22, 2016
starter_suite_test.go org move + vendoring with go dep Jul 12, 2018
utils.go org move + vendoring with go dep Jul 12, 2018

README.md

Starter

Codeship Status for cloud66/starter

Starter is an open source command line tool to generate a Dockerfile and a docker-compose.yml file from arbitrary source code. It will kickstart the journey towards containerizing your apps.

Starter can also generate the service.yml file, which is a Cloud 66 service definition file used to define the service configurations that run Docker in production on any cloud, or on your own serve

Logo Starter an open source dockerfile generator

Key features:


  • Detects frameworks and its version, i.e. Rails v5.0, PHP Laravel and Node.JS express to name a few.
  • Determines the ports that need setting.
  • Detects what database you’re using, to setup your databases in docker-compose.
  • Compatible with Procfiles to generate services for you.
  • Examines your application to generate appropriate Dockerfile, docker-compose.yml, and service.yml files.
  • Has an API to integrate Starter into you own product.

Why Starter?


  • You’re new to Docker, have got the basic 101 content and are now ready to start using Docker:
    Starter is an ideal tool to support you with your first Docker deployment. It’s the easiest way to learn how to containerize your application, and is a great step to ease you through the Docker learning curve. It automates the process, allowing you to focus on the things that matter.

  • You’re in need of containerizing your existing application:
    Starter helps you analyze your existing application and detects what framework the application is running and in what version. Additionally, it automatically detects what database and ports you’re using.

    Next it will generate a Dockerfile, DockerCompose or service.yml that is ready to run in containers. This helps you with faster builds and prepares you to run Docker in production.

Reasons to containerize your applications

  • If you need to achieve multi-tenancy
    There are a couple reasons why you would need to run multiple applications on the same stack, i.e. the applications that you’re running share common resources or your applications don’t receive enough traffic to run on separate stacks. This is where Starter can help to Dockerize each of your applications, which you can host on a single stack.

  • If you have a specialized application that requires a sandbox environment
    With the new security features of Docker, you get true isolation of your process. When using Starter you can isolate parts of your apps in containers and make sure they’re in a sandbox (and can’t do harmful things!).

Documentations:


Comprehensive documentation is available on the Starter website:

http://www.startwithdocker.com/

Quick Start:


Just run the install script on macOS or Linux!

curl -sSL https://raw.githubusercontent.com/cloud66/starter/master/install.sh | bash

Or download Starter straight from this repo. Starter can run on Linux, Windows and macOS. Copy the Starter application into /usr/local/bin/starter and check if it has the executable flags, if not run chmod a+x /usr/local/bin/starter. Containerize your first application with Starter now:

$ cd /my/project
$ starter -g dockerfile,service,docker-compose

This will analyze the project in the current folder and generate the three files: Dockerfile, docker-compose.yml and service.yml` in the same folder, prompting for information when required.

Cloud 66 Starter ~ (c) 2017 Cloud 66
Detecting framework for the project at /Users/awesome/work/boom
Found ruby application
Enter ruby version: [latest]
----> Found config/database.yml
Found mysql, confirm? [Y/n]
Found redis, confirm? [Y/n]
Found elasticsearch, confirm? [Y/n]
Add any other databases? [y/N]
----> Analyzing dependencies
----> Parsing Procfile
----> Found Procfile item web
----> Found Procfile item worker
----> Found unicorn
This command will be run after each build: '/bin/sh -c "RAILS_ENV=_env:RAILS_ENV bundle exec rake db:schema:load"', confirm? [Y/n]
This command will be run after each deployment: '/bin/sh -c "RAILS_ENV=_env:RAILS_ENV bundle exec rake db:migrate"', confirm? [Y/n]
----> Writing Dockerfile...
----> Writing docker-compose.yml...
----> Writing service.yml
Done

Starter supports Procfiles and generates a service in service.yml for each item in the Procfile. It is highly advised to use a Procfile to define your own service commands as starter will only detect the web service otherwise.

To use starter on a different folder, you can use the p option:

$ starter -p /my/project

For more options, please see:

$ starter help

Building Starter using Habitus


If you want to contribute to Starter. You can build Starter using Habitus. Habitus is an open source build flow tool for Docker.

Run Habitus in the root directory of this repository. The latest version is generated (after tests) inside the ./artifacts/compiled directory.

habitus --keep-artifacts=true

To make sure you a have isolated development environment for contribution. You can use the docker-compose for developing, testing and compiling.

$ docker-compose run starter

Building starter inside a docker container:

root@xx:/usr/local/go/src/github.com/cloud66/starter# go build

Running the tests:

root@xx:/usr/local/go/src/github.com/cloud66/starter# go test

And you’re ready to start contributing to Starter.