Skip to content
This repository has been archived by the owner on Mar 27, 2022. It is now read-only.

Commit

Permalink
line breaks, imgs, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
iynere committed Dec 28, 2017
1 parent 26705cb commit bb72cb1
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 49 deletions.
66 changes: 37 additions & 29 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,66 @@
image_config: &image_config

# make sure to set your Docker Hub username and password in CircleCI, either as project-specific environment variables or as resources in your organization's org-global Context
# make sure to set your Docker Hub username & password in CircleCI,
# either as project-specific environment variables
# or as resources in your organization's org-global Context

IMAGE_NAME: # name your image (no spaces please!)

IMAGE_TAG: # give your image a tag (no spaces please!)

# NOTE: if you're modifying this config.yml file manually rather than using the included setup script, make sure you also add the values of your IMAGE_NAME and IMAGE_TAG variables to the `test_image` job (line 52)

LINUX_VERSION: # options: DEBIAN_JESSIE, DEBIAN_STRETCH, UBUNTU_TRUSTY, UBUNTU_XENIAL

RUBY_VERSION_NUM: # pick a version number from https://cache.ruby-lang.org/pub/ruby

NODE_VERSION_NUM: # pick a version number from https://nodejs.org/dist

PYTHON_VERSION_NUM: # pick a version number from https://python.org/ftp/python


# NOTE: if you're modifying this config.yml file manually
# rather than using the included setup script,
# make sure you also add the values of your IMAGE_NAME & IMAGE_TAG variables
# to the `test_image` job (line 58)

LINUX_VERSION: # DEBIAN_JESSIE, DEBIAN_STRETCH, UBUNTU_TRUSTY, or UBUNTU_XENIAL

RUBY_VERSION_NUM: # pick a version from https://cache.ruby-lang.org/pub/ruby

NODE_VERSION_NUM: # pick a version from https://nodejs.org/dist

PYTHON_VERSION_NUM: # pick a version from https://python.org/ftp/python

JAVA: # Java options: true, false

MYSQL_CLIENT: # MySQL options: true, false

POSTGRES_CLIENT: # Postgres options: true, false

BROWSERS: # install browsers/tools (Xvfb, PhantomJS, Firefox, Chrome, Chromedriver) for browser testing: true, false

# NOTE: if you are modifying this config.yml file manually, make sure to also comment out the accompanying `run` steps (lines 58-74) in the `test_image` job for any languages/dependencies that you are not installing in your Docker image

BROWSERS: # browser tools (Xvfb, PhantomJS, Firefox, Chrome, Chromedriver): true, false

# NOTE: if you are modifying this config.yml file manually,
# make sure to also comment out the accompanying `run` steps (lines 66-82)
# in the `test_image` job for any languages/dependencies
# that you are not installing in your Docker image

version: 2
jobs:
build:
machine: true
environment:
<<: *image_config

steps:
- checkout

## - run: bash generate.sh > Dockerfile

## - run: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD

## - run: docker build -t $DOCKER_USERNAME/$IMAGE_NAME:$IMAGE_TAG .

## - run: docker push $DOCKER_USERNAME/$IMAGE_NAME:$IMAGE_TAG && sleep 10

## - store_artifacts:
## path: Dockerfile

## test_image:
## docker:
## - image: $DOCKER_USERNAME/(name of image):(image tag)

## steps:

## - checkout

## - run: lsb_release -a
Expand All @@ -72,14 +80,14 @@ jobs:
## - run: firefox --version
## - run: google-chrome --version
## - run: chromedriver --version

##workflows:
## version: 2
## dockerfile_wizard:
## jobs:
## - build:
## context: org-global

## - test_image:
## context: org-global
## requires:
Expand Down
35 changes: 24 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,35 @@ This tool can help you easily build Docker images with different versions/combin

## Prerequisites

- CircleCI account
- Docker Hub account
- Some version of `make`
- [CircleCI account](https://circleci.com/signup)
- [Docker Hub account](https://hub.docker.com) (Docker itself **does not** need to be installed on your computer, however)
- [Make](https://en.wikipedia.org/wiki/Make_(software)) & [Perl](https://perl.org) (included in most macOS & Linux installations)

## Usage

1. Fork this repository and start building it on CircleCI
1. Add your Docker Hub username (`DOCKER_USERNAME`) and password (`DOCKER_PASSWORD`) to your CircleCI account, either as project-specific environment variables, or as resources in your **org-global** (default) [Context](https://circleci.com/docs/2.0/contexts)
1. Clone your fork of the project down to your local machine
1. Enter the cloned directory and run `make ready` to prepare the `config.yml` file for building Docker images on CircleCI
1. Run `./setup` in the cloned directory, or else manually add the versions/dependencies that you need to `.circleci/config.yml` as specified in the [`image_config` section](https://github.com/circleci/dockerfile-wizard/blob/231237de1f6aaa0d197998044867816e0f8e7454/.circleci/config.yml#L1)
1. Commit and push your changes
**1. Fork this repository and start building it on CircleCI:**

Once the build has finished, your image will be available at `http://hub.docker.com/r/DOCKER_USERNAME/IMAGE_NAME` and can be used in other projects building on CircleCI. (The Dockerfile for your image is stored as an artifact in this project's `build` job.)
![Setup Project](https://raw.githubusercontent.com/CircleCI-Public/dockerfile-wizard/master/img/setup%20project.jpg "Setup Project")

To use the Docker Wizard again, run `make reset` in the cloned directory, then repeat steps 4-6.
**2. Add your Docker Hub username (`DOCKER_USERNAME`) and password (`DOCKER_PASSWORD`) to your CircleCI account, either as project-specific environment variables (shown below), or as resources in your **org-global** (default) [Context](https://circleci.com/docs/2.0/contexts)**

![Environment Variables](https://raw.githubusercontent.com/CircleCI-Public/dockerfile-wizard/master/img/env%20vars.jpg "Environment Variables")

**3.** Clone your fork of the project onto your computer

**4.** Enter the cloned `dockerfile-wizard` directory and run `make ready` to prepare the `config.yml` file for building Docker images on CircleCI

**5.** Run `./setup` in the cloned directory, or else manually add the versions/dependencies that you need to `.circleci/config.yml` as specified in the [`image_config` section](https://github.com/circleci/dockerfile-wizard/blob/231237de1f6aaa0d197998044867816e0f8e7454/.circleci/config.yml#L1)

**6.** Commit and push your changes

Once the build has finished, your image will be available at `http://hub.docker.com/r/DOCKER_USERNAME/IMAGE_NAME` and can be used in other projects building on CircleCI. (The Dockerfile for your image will be stored as an artifact in this project's `build` job.)

To use the Docker Wizard again, run `make reset` in the cloned directory, then repeat steps **4-6**.

### Notes

- x

### To-do

Expand Down
Binary file added img/env vars.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/setup project.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 9 additions & 9 deletions setup
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ Pick a Linux version for your image:

case "$LINUX_VERSION" in
1)
perl -i -pe 's/# options: DEBIAN_JESSIE, DEBIAN_STRETCH, UBUNTU_TRUSTY, UBUNTU_XENIAL/DEBIAN_JESSIE/' .circleci/config.yml
perl -i -pe 's/# DEBIAN_JESSIE, DEBIAN_STRETCH, UBUNTU_TRUSTY, or UBUNTU_XENIAL/DEBIAN_JESSIE/' .circleci/config.yml
;;
2)
perl -i -pe 's/# options: DEBIAN_JESSIE, DEBIAN_STRETCH, UBUNTU_TRUSTY, UBUNTU_XENIAL/DEBIAN_STRETCH/' .circleci/config.yml
perl -i -pe 's/# DEBIAN_JESSIE, DEBIAN_STRETCH, UBUNTU_TRUSTY, or UBUNTU_XENIAL/DEBIAN_STRETCH/' .circleci/config.yml
;;
3)
perl -i -pe 's/# options: DEBIAN_JESSIE, DEBIAN_STRETCH, UBUNTU_TRUSTY, UBUNTU_XENIAL/UBUNTU_TRUSTY/' .circleci/config.yml
perl -i -pe 's/# DEBIAN_JESSIE, DEBIAN_STRETCH, UBUNTU_TRUSTY, or UBUNTU_XENIAL/UBUNTU_TRUSTY/' .circleci/config.yml
;;
4)
perl -i -pe 's/# options: DEBIAN_JESSIE, DEBIAN_STRETCH, UBUNTU_TRUSTY, UBUNTU_XENIAL/UBUNTU_XENIAL/' .circleci/config.yml
perl -i -pe 's/# DEBIAN_JESSIE, DEBIAN_STRETCH, UBUNTU_TRUSTY, or UBUNTU_XENIAL/UBUNTU_XENIAL/' .circleci/config.yml
;;
esac

Expand All @@ -42,7 +42,7 @@ Pick a Ruby version from https://cache.ruby-lang.org/pub/ruby (i.e., 2.4.2, etc.
: " RUBY_VERSION_NUM

if [ "$RUBY_VERSION_NUM" ] ; then
perl -i -pe "s/# pick a version number from https:\/\/cache.ruby-lang.org\/pub\/ruby/$RUBY_VERSION_NUM/" .circleci/config.yml
perl -i -pe "s/# pick a version from https:\/\/cache.ruby-lang.org\/pub\/ruby/$RUBY_VERSION_NUM/" .circleci/config.yml
else
perl -i -pe "s/RUBY_VERSION_NUM:/# RUBY_VERSION_NUM:/" .circleci/config.yml
perl -i -pe "s/- run: ruby/# - run: ruby/" .circleci/config.yml
Expand All @@ -53,7 +53,7 @@ Pick a Node version from https://nodejs.org/dist, or hit enter to skip installin
: " NODE_VERSION_NUM

if [ "$NODE_VERSION_NUM" ] ; then
perl -i -pe "s/# pick a version number from https:\/\/nodejs.org\/dist/$NODE_VERSION_NUM/" .circleci/config.yml
perl -i -pe "s/# pick a version from https:\/\/nodejs.org\/dist/$NODE_VERSION_NUM/" .circleci/config.yml
else
perl -i -pe "s/NODE_VERSION_NUM:/# NODE_VERSION_NUM:/" .circleci/config.yml
perl -i -pe "s/- run: node/# - run: node/" .circleci/config.yml
Expand All @@ -64,7 +64,7 @@ Pick a Python version from https://python.org/ftp/python, or hit enter to skip i
: " PYTHON_VERSION_NUM

if [ "$PYTHON_VERSION_NUM" ] ; then
perl -i -pe "s/# pick a version number from https:\/\/python.org\/ftp\/python/$PYTHON_VERSION_NUM/" .circleci/config.yml
perl -i -pe "s/# pick a version from https:\/\/python.org\/ftp\/python/$PYTHON_VERSION_NUM/" .circleci/config.yml
else
perl -i -pe "s/PYTHON_VERSION_NUM:/# PYTHON_VERSION_NUM:/" .circleci/config.yml
perl -i -pe "s/- run: python/# - run: python/" .circleci/config.yml
Expand Down Expand Up @@ -118,10 +118,10 @@ Does your project need web browsers for browser testing? Enter the word 'yes' to

case "$BROWSERS" in
yes)
perl -i -pe 's/# install browsers\/tools \(Xvfb, PhantomJS, Firefox, Chrome, Chromedriver\) for browser testing: true, false/true/' .circleci/config.yml
perl -i -pe 's/# browser tools \(Xvfb, PhantomJS, Firefox, Chrome, Chromedriver\): true, false/true/' .circleci/config.yml
;;
*)
perl -i -pe 's/# install browsers\/tools \(Xvfb, PhantomJS, Firefox, Chrome, Chromedriver\) for browser testing: true, false/false/' .circleci/config.yml
perl -i -pe 's/# browser tools \(Xvfb, PhantomJS, Firefox, Chrome, Chromedriver\): true, false/false/' .circleci/config.yml
perl -i -pe "s/- run: # phantomjs/# - run: # phantomjs/" .circleci/config.yml
perl -i -pe "s/name: verify phantomjs/# name: verify phantomjs/" .circleci/config.yml
perl -i -pe "s/command: Xvfb/# command: Xvfb/" .circleci/config.yml
Expand Down

0 comments on commit bb72cb1

Please sign in to comment.