{"action":"created","issue":{"url":"https://api.github.com/repos/codeship/documentation/issues/489","repository_url":"https://api.github.com/repos/codeship/documentation","labels_url":"https://api.github.com/repos/codeship/documentation/issues/489/labels{/name}","comments_url":"https://api.github.com/repos/codeship/documentation/issues/489/comments","events_url":"https://api.github.com/repos/codeship/documentation/issues/489/events","html_url":"https://github.com/codeship/documentation/issues/489","id":180125643,"number":489,"title":"Should mention creation of the `Gemfile`","user":{"login":"earnold","id":169206,"avatar_url":"https://avatars.githubusercontent.com/u/169206?v=3","gravatar_id":"","url":"https://api.github.com/users/earnold","html_url":"https://github.com/earnold","followers_url":"https://api.github.com/users/earnold/followers","following_url":"https://api.github.com/users/earnold/following{/other_user}","gists_url":"https://api.github.com/users/earnold/gists{/gist_id}","starred_url":"https://api.github.com/users/earnold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/earnold/subscriptions","organizations_url":"https://api.github.com/users/earnold/orgs","repos_url":"https://api.github.com/users/earnold/repos","events_url":"https://api.github.com/users/earnold/events{/privacy}","received_events_url":"https://api.github.com/users/earnold/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-29T18:26:37Z","updated_at":"2016-10-04T11:30:31Z","closed_at":null,"body":"Location: https://github.com/codeship/documentation/blob/master/_posts/docker/guide/2015-06-10-getting-started.md\r\n\r\nIn this tutorial, you describe every step except for creating the Gemfile and running bundler locally (to create the Gemfile.lock)\r\n\r\nIt was easy to figure out what was wrong, but I think tweaking this would be a nice improvement. \r\n\r\n\r\nA fix would be to say something like: \r\n\r\nCreate a `Gemfile` and add to it the following: \r\n\r\n```\r\nsource 'https://rubygems.org'\r\n\r\nruby '2.2.1'\r\n\r\ngem 'redis'\r\ngem 'pg'\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/codeship/documentation/issues/comments/251363177","html_url":"https://github.com/codeship/documentation/issues/489#issuecomment-251363177","issue_url":"https://api.github.com/repos/codeship/documentation/issues/489","id":251363177,"user":{"login":"mlocher","id":7791,"avatar_url":"https://avatars.githubusercontent.com/u/7791?v=3","gravatar_id":"","url":"https://api.github.com/users/mlocher","html_url":"https://github.com/mlocher","followers_url":"https://api.github.com/users/mlocher/followers","following_url":"https://api.github.com/users/mlocher/following{/other_user}","gists_url":"https://api.github.com/users/mlocher/gists{/gist_id}","starred_url":"https://api.github.com/users/mlocher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlocher/subscriptions","organizations_url":"https://api.github.com/users/mlocher/orgs","repos_url":"https://api.github.com/users/mlocher/repos","events_url":"https://api.github.com/users/mlocher/events{/privacy}","received_events_url":"https://api.github.com/users/mlocher/received_events","type":"User","site_admin":false},"created_at":"2016-10-04T11:30:30Z","updated_at":"2016-10-04T11:30:30Z","body":"Hey @earnold, \r\n\r\nthe sample repository at https://github.com/codeship/ci-guide/tree/master/part1 already has the `Gemfile.lock` included in the repository, so we don't mention the steps for how to create it in the guide.\r\n\r\nIf you don't have the `Gemfile.lock` available yet, I'd recommend running the `bundle install` command to create it inside a Docker container as well. Otherwise you'd need to install the required version of Ruby and Bundler outside of the container, partly defeating the purpose.\r\n\r\nTo do this, you'd need to modify the `Dockerfile` to not copy the `Gemfile.lock` during the build process and then use `docker run` to run a Bundler. \r\n\r\nWith a `Dockerfile` like the following\r\n\r\n```Dockerfile\r\n# base on latest ruby base image\r\nFROM ruby:2.2.1\r\nMAINTAINER marko@codeship.com\r\n\r\nENV DEBIAN_FRONTEND=noninteractive \r\n\r\n# update and install dependencies\r\nRUN \\\r\n  apt-get update -qq && \\\r\n  apt-get install -y \\\r\n    apt-utils \\\r\n    build-essential\\\r\n    libpq-dev \\\r\n    nodejs\r\n\r\n# setup app folders\r\nRUN mkdir /app\r\nWORKDIR /app\r\n\r\n# copy over Gemfile\r\nCOPY Gemfile ./\r\n```\r\n\r\nyou'd then run the following commands\r\n\r\n```\r\ndocker build --tag app .\r\ndocker run -it -v $(pwd):/app app bundle install\r\n```\r\n\r\nThat will run `bundle install` in the container, but as the current directory (`$(pwd)`) is mounted  as a volume to `/app` inside the container, any changes made by Bundler will be reflected in the current directory as well.\r\n\r\nOnce the `Gemfile.lock` is available you could then switch to the complete `Dockerfile` and continue building your application."}}
{"actor":{"display_login":"mlocher"}}