Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerize #181

Merged
merged 1 commit into from
Nov 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM ruby:2.4.2-jessie

# Clone sendgrid-ruby
WORKDIR /sources
RUN git clone https://github.com/sendgrid/sendgrid-ruby.git

# Bundle
WORKDIR /sources/sendgrid-ruby
RUN bundle install

# Install prism
RUN curl https://raw.githubusercontent.com/stoplightio/prism/master/install.sh | sh
30 changes: 30 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Docker image for sendgrid-ruby

## Quickstart
1. [Install Docker](https://docs.docker.com/engine/installation/) on your machine.
2. Run `docker run --rm -it sendgrid/sendgrid-ruby irb`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the irb at the end there?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea was to get a interpretor where a dev could try out the gem without having to run it.

3. Run `require './lib/sendgrid-ruby.rb'`.

## Poke around

If you would like to just poke around in the image and check some examples:
```sh
docker run --rm -it sendgrid/sendgrid-ruby bash
```

If you want to mount your fork or specific version of the gem:
```sh
docker run --rm -v /path/to/local/sendgrid-ruby:/sources/sendgrid-ruby -it sendgrid/sendgrid-ruby bash

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you be up for adding a docker-compose file that would make the ruby gems and source code local to the machine the container is running on?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will the volumes not be sufficient for this?

```

## Running tests

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome. thank you!!


If you would like to run the tests present in the image:
```sh
docker run --rm sendgrid/sendgrid-ruby rake
```

If you want to run tests on your fork or a specific version, mount the codebase onto the image:
```sh
docker run --rm -v /path/to/local/sendgrid-ruby:/sources/sendgrid-ruby sendgrid/sendgrid-ruby rake
```