{"id":6086,"date":"2015-07-28T16:15:26","date_gmt":"2015-07-28T13:15:26","guid":{"rendered":"http:\/\/www.webcodegeeks.com\/?p=6086"},"modified":"2015-12-16T11:29:15","modified_gmt":"2015-12-16T09:29:15","slug":"build-minimal-docker-container-ruby-apps","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/","title":{"rendered":"Build a Minimal Docker Container for Ruby Apps"},"content":{"rendered":"<p>As a Ruby and Rails developer, I\u2019ve always wanted to have a working and isolated environment for my projects, regardless if it\u2019s a client project, some gem that I work on, or a pet project. Back in the day, I had always wanted to achieve this using Vagrant. However, whenever I tried to do it, I always ended up spending a couple of hours on Stack Overflow before giving up.<\/p>\n<p>And even if your middle name is \u201cperseverance\u201d and you manage to get a working bootstrapped environment, often there are problems with system libraries or slight differences in the system environments which can cause problems.<\/p>\n<p>In this article, we are going to build a Docker image with a working Ruby environment and deploy a Ruby application to a container. By using Docker, we will ensure that the environment will always be the same, and it will be easy to reproduce.<\/p>\n<p>One thing to note \u2014 we will not cover Docker installation. If you do not have Docker installed, you can head over to <a href=\"https:\/\/docs.docker.com\/installation\/\">the Docker documentation<\/a> and install it.<\/p>\n<h2>Part One: Our Application<\/h2>\n<p>Since we\u2019re going to deploy an application to our container, we need a tiny Ruby application. The app that we will deploy will be called Checker. It\u2019s only purpose is that it will check if a gem name is available on RubyGems or not. If it\u2019s available, it will return true; otherwise, false.<\/p>\n<p>We will overcomplicate this application a bit. We will use a gem called <strong>curb<\/strong>, which is just a Ruby wrapper for curl. Yes, we can just shell out and use curl, but for the purpose of this tutorial we will use <strong>curb<\/strong>.<\/p>\n<p>Here is the code for our tiny Checker application:<\/p>\n<pre class=\" brush:php\"># checker.rb\r\nrequire 'rubygems' require 'curb'\r\n\r\ngem_name = ARGV[0]\r\n\r\nraise ArgumentError.new(\"gem name missing\") if gem_name.nil?\r\n\r\nif Curl.get(\"https:\/\/rubygems.org\/gems\/#{gem_name}\").status == '200 OK' \r\n  $stdout.puts 'Name not available.' \r\nelse \r\n  $stdout.puts 'Name available.' \r\nend<\/pre>\n<p>Using this app is easy. Just run:<\/p>\n<pre class=\" brush:php\">ruby checker.rb &lt;gem-name&gt;<\/pre>\n<h2>Part Two: Creating the Docker Image<\/h2>\n<p>Since the guys behind Docker are awesome, we can use the official Docker image for Ruby. To use this image, we would write an \u201conbuild\u201d Dockerfile like this:<\/p>\n<pre class=\" brush:php\">FROM ruby:2.1-onbuild \r\nCMD [\".\/your-daemon-or-script.rb\"]<\/pre>\n<p>We need to put the Dockerfile in our app directory, next to the Gemfile. The \u201cmagic\u201d behind the <strong>:onbuild<\/strong> tagged images is that they assume that your project structure is standard, and it will build your Ruby application as a generic Ruby application. If you prefer more control over the build, you can always use base Ruby image and build the app yourself:<\/p>\n<pre class=\" brush:php\">FROM ruby:latest \r\nRUN mkdir \/usr\/src\/app \r\nADD . \/usr\/src\/app\/ \r\nWORKDIR \/usr\/src\/app\/ \r\nCMD [\"\/usr\/src\/app\/main.rb\"]<\/pre>\n<p>The extra control is really nice if you need to do some additional setup for your Ruby application. Perhaps you want to run the tests or use some external API to check for code metrics. Use your imagination!<\/p>\n<p>Using official Docker images for Ruby is great and all, but there\u2019s one very big drawback. They. Are. HUGE. The Ruby image is roughly 1.6 GB. If we\u2019re running a tiny Ruby app, like the one in our example, having this big image is nonsense. Just an observation \u2014 I\u2019m not saying the official images are bad or useless. What I am saying is that you have to be sure that you actually <em>need<\/em> an image that advanced.<\/p>\n<h2>Part Three: How About We Build a Tiny Ruby Docker Image?<\/h2>\n<p>Since we need a really small image for running our application, let\u2019s see how we can build one. <a href=\"https:\/\/www.alpinelinux.org\/\">Alpine Linux<\/a> is a very tiny Linux distribution. It\u2019s built on <a href=\"http:\/\/www.busybox.net\/\">BusyBox<\/a>, and it includes only the minimum files needed to boot and run the operating system.<\/p>\n<p>In our Ruby application directory, let\u2019s create the Dockerfile:<\/p>\n<pre class=\" brush:php\">FROM alpine:3.2 \r\nMAINTAINER John Doe &lt;john@doe.com&gt;<\/pre>\n<p>We will use the official <a href=\"https:\/\/registry.hub.docker.com\/_\/alpine\/\">Alpine image<\/a> for Docker, which weighs an awesome 5MBs!<\/p>\n<p>Alpine Linux uses its own package manager called <strong>apk<\/strong>. As a first step of the Dockerfile, we\u2019ll need to update the repositories of the package manager. Also, since we want to work with the newest available packages, we need to upgrade the installed packages.<\/p>\n<pre class=\" brush:php\">FROM alpine:3.2 \r\nMAINTAINER John Doe &lt;john@doe.com&gt;\r\n\r\nRUN apk update &amp;&amp; apk upgrade<\/pre>\n<p>As you can see, updating the repositories is done via \u201capk update\u201d, while upgrading the installed packages is done via \u201capk upgrade\u201d.<\/p>\n<p>My personal preference is to always have a couple of useful binaries installed, like curl, wget, and bash. Installation of packages in Alpine Linux is done with the <code>apk add &lt;package-name&gt;<\/code> command. Let\u2019s add these to the Dockerfile:<\/p>\n<pre class=\" brush:php\">FROM alpine:3.2 \r\nMAINTAINER John Doe &lt;john@doe.com&gt;\r\n\r\nRUN apk update \r\nRUN apk upgrade \r\nRUN apk add curl wget bash<\/pre>\n<p>This means that when building our image, we\u2019ll have curl, wget, and bash installed in our image. Next, we need to install Ruby. When installing Ruby, we need to install the latest Ruby distribution and ruby-bundler. The Ruby distribution is the language itself, while ruby-bundler is Bundler wrapped in an apk package. Let\u2019s add these to the Dockerfile:<\/p>\n<pre class=\" brush:php\">FROM alpine:3.2 \r\nMAINTAINER John Doe &lt;john@doe.com&gt;\r\n\r\n# Install base packages\r\nRUN apk update \r\nRUN apk upgrade \r\nRUN apk add curl wget bash\r\n\r\n# Install ruby and ruby-bundler\r\nRUN apk add ruby ruby-bundler<\/pre>\n<p>After having Ruby and ruby-bundler installed, it\u2019s considered good practice to clean up after ourselves. Since we only installed a couple of packages, we need to remove the cache of the package manager. Alpine\u2019s package manager keeps its cache in the \/var\/cache path, so removing the cache is as easy as removing everything in the \/var\/cache\/apk path. Let\u2019s add that step to the Dockerfile:<\/p>\n<pre class=\" brush:php\">FROM alpine:3.2 \r\nMAINTAINER John Doe &lt;john@doe.com&gt;\r\n\r\n# Install base packages\r\nRUN apk update \r\nRUN apk upgrade \r\nRUN apk add curl wget bash\r\n\r\n# Install ruby and ruby-bundler\r\nRUN apk add ruby ruby-bundler\r\n\r\n# Clean APK cache\r\nRUN rm -rf \/var\/cache\/apk\/*<\/pre>\n<p>Next, we need to include our tiny Checker application in this container, so that every time we create a new container it\u2019s available to us. First, we need to create a new directory and copy the files of the application in the directory. The last step is to bundle the application.<\/p>\n<pre class=\" brush:php\">FROM alpine:3.2 \r\nMAINTAINER John Doe &lt;john@doe.com&gt;\r\n\r\n# Update and install base packages\r\nRUN apk update &amp;&amp; apk upgrade &amp;&amp; apk add curl wget bash\r\n\r\n# Install ruby and ruby-bundler\r\nRUN apk add ruby ruby-bundler\r\n\r\n# Clean APK cache\r\nRUN rm -rf \/var\/cache\/apk\/*\r\n\r\nRUN mkdir \/usr\/app \r\nWORKDIR \/usr\/app\r\n\r\nCOPY Gemfile \/usr\/app\/ \r\nCOPY Gemfile.lock \/usr\/app\/ \r\nRUN bundle install\r\n\r\nCOPY . \/usr\/app<\/pre>\n<p>The last step of our app is building the image. Just a reminder, it\u2019s very important to have the Dockerfile within the project directory, so Docker can copy the project files to the image. Building the image is easy using the docker build command:<\/p>\n<pre class=\" brush:php\">docker build jdoe\/ruby .<\/pre>\n<p>This will build our image. Or it should. If you\u2019ve been following along and tried building this image, you would get a stack trace that looks something like this:<\/p>\n<pre class=\" brush:php\">\/usr\/lib\/ruby\/2.2.0\/rubygems\/core_ext\/kernel_require.rb:54:in `require': cannot load such file -- io\/console (LoadError)<\/pre>\n<p>This means that Ruby requires the \u201cio\/console\u201d library which is provided by the io-console gem. When it comes to Alpine Linux, the folks behind the project have added a <strong>ruby-io-console<\/strong> package that fixes this dependency. What we only need to do is to add this package to the Dockerfile:<\/p>\n<pre class=\" brush:php\"># Install ruby, ruby-io-console and ruby-bundler\r\nRUN apk add ruby ruby-io-console ruby-bundler<\/pre>\n<p>If we try to rebuild the image, everything will go well, and we\u2019ll get to the point of installing the bundle. At this point, you will understand why the official Ruby image from Docker is ~1.6GB. The reason is that gems can have different dependencies, whether those dependencies are system binaries\/packages or other gems. And this can get quite recursive. So what Docker did with the official Ruby image is they added <em>every package<\/em> that you might need when you install your bundle.<\/p>\n<p>So, going back to our image, when we try to rebuild the image, we will get something like this error:<\/p>\n<pre class=\" brush:php\">Gem::Ext::BuildError: ERROR: Failed to build gem native extension.\r\n\r\n    \/usr\/bin\/ruby -r .\/siteconf20150714-5-1oit3ix.rb extconf.rb\r\nmkmf.rb can't find header files for ruby at \/usr\/lib\/ruby\/include\/ruby.h<\/pre>\n<p>As you can see in the error, we\u2019re missing header files for Ruby. Although this might look a bit scary, it\u2019s easily fixable by installing the ruby-dev package. Apart from the header files, we will need the build packages (called build-base) for Alpine Linux, so we can compile the build the gems in our image.<\/p>\n<pre class=\" brush:php\">FROM alpine:3.2 \r\nMAINTAINER John Doe &lt;john@doe.com&gt;\r\n\r\nENV BUILD_PACKAGES curl-dev ruby-dev build-base\r\n\r\n# Update and install base packages\r\nRUN apk update &amp;&amp; apk upgrade &amp;&amp; apk add bash $BUILD_PACKAGES\r\n\r\n# Install ruby and ruby-bundler\r\nRUN apk add ruby ruby-io-console ruby-bundler\r\n\r\nRUN mkdir \/usr\/app \r\nWORKDIR \/usr\/app\r\n\r\nCOPY Gemfile \/usr\/app\/ \r\nCOPY Gemfile.lock \/usr\/app\/ \r\nRUN bundle install\r\n\r\nCOPY . \/usr\/app\r\n\r\n# Clean APK cache\r\nRUN rm -rf \/var\/cache\/apk\/*<\/pre>\n<p>Now, if you try to rebuild your image, you can see that everything will go well. The image is built, and the application is deployed at the \/usr\/app path.<\/p>\n<p>The penultimate step would be to clean up our Dockerfile. We will move the build-essential package names to an environment variable called BUILD_PACKAGES. We will do the same with the other, Ruby-focused packages as an environment variable called RUBY_PACKAGES.<\/p>\n<p>The last step is to concatenate all of the package manipulation commands to a single command. We will do this because each RUN command creates a new layer in the image history. That means when we pull the image from the Docker Hub, the data that was removed will still end up getting pulled because it\u2019s an intermediate step. By concatenating all of the commands, we will create only one layer in the image history where the packages will be installed and the cache cleaned.<\/p>\n<pre class=\" brush:php\">FROM alpine:3.2\r\nMAINTAINER John Doe &lt;john@doe.com&gt;\r\n\r\nENV BUILD_PACKAGES bash curl-dev ruby-dev build-base\r\nENV RUBY_PACKAGES ruby ruby-io-console ruby-bundler\r\n\r\n# Update and install all of the required packages.\r\n# At the end, remove the apk cache\r\nRUN apk update &amp;&amp; \\\r\n    apk upgrade &amp;&amp; \\\r\n    apk add $BUILD_PACKAGES &amp;&amp; \\\r\n    apk add $RUBY_PACKAGES &amp;&amp; \\\r\n    rm -rf \/var\/cache\/apk\/*\r\n\r\nRUN mkdir \/usr\/app\r\nWORKDIR \/usr\/app\r\n\r\nCOPY Gemfile \/usr\/app\/\r\nCOPY Gemfile.lock \/usr\/app\/\r\nRUN bundle install\r\n\r\nCOPY . \/usr\/app<\/pre>\n<h2>Conclusion<\/h2>\n<p>The goal of this post was to build a minimal Docker image for a Ruby application. As you can see, there are many moving parts that you have to take into consideration when it comes to building it. Various gems have various dependencies, and knowing what packages every gem depends on in advance is almost impossible.<\/p>\n<p>My conclusion is that building a very minimal Docker image for Ruby is very hard. Building it is very much directed by what are the minimal requirements for the application that we want to deploy within the container. When it comes to compiled languages, like Java, one can compile the application with its dependencies outside of the container and deploy the compiled app (with its dependencies) to a container that only has a JVM. Because this is not an option with Ruby, it would be best to gradually build your own minimal images that will work for your application.<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"http:\/\/blog.codeship.com\/build-minimal-docker-container-ruby-apps\/\">Build a Minimal Docker Container for Ruby Apps<\/a> from our <a href=\"http:\/\/www.webcodegeeks.com\/wcg\/\">WCG partner<\/a> Florian Motlik at the <a href=\"http:\/\/blog.codeship.com\/\">Codeship Blog<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>As a Ruby and Rails developer, I\u2019ve always wanted to have a working and isolated environment for my projects, regardless if it\u2019s a client project, some gem that I work on, or a pet project. Back in the day, I had always wanted to achieve this using Vagrant. However, whenever I tried to do it, &hellip;<\/p>\n","protected":false},"author":125,"featured_media":927,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[217,95],"class_list":["post-6086","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-development","tag-docker","tag-rails"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Build a Minimal Docker Container for Ruby Apps - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"As a Ruby and Rails developer, I\u2019ve always wanted to have a working and isolated environment for my projects, regardless if it\u2019s a client project, some\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Build a Minimal Docker Container for Ruby Apps - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"As a Ruby and Rails developer, I\u2019ve always wanted to have a working and isolated environment for my projects, regardless if it\u2019s a client project, some\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2015-07-28T13:15:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2015-12-16T09:29:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ilija Eftimov\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@fteem\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ilija Eftimov\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/\"},\"author\":{\"name\":\"Ilija Eftimov\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/b0a347492d44c5dca7501616667317ff\"},\"headline\":\"Build a Minimal Docker Container for Ruby Apps\",\"datePublished\":\"2015-07-28T13:15:26+00:00\",\"dateModified\":\"2015-12-16T09:29:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/\"},\"wordCount\":1507,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg\",\"keywords\":[\"Docker\",\"Rails\"],\"articleSection\":[\"Web Dev\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/\",\"name\":\"Build a Minimal Docker Container for Ruby Apps - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg\",\"datePublished\":\"2015-07-28T13:15:26+00:00\",\"dateModified\":\"2015-12-16T09:29:15+00:00\",\"description\":\"As a Ruby and Rails developer, I\u2019ve always wanted to have a working and isolated environment for my projects, regardless if it\u2019s a client project, some\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Web Dev\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/web-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Build a Minimal Docker Container for Ruby Apps\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/b0a347492d44c5dca7501616667317ff\",\"name\":\"Ilija Eftimov\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/4e15cb15248ba112c8d6a3925d4fc237bdff4bfe078c886aa91194df713bf771?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/4e15cb15248ba112c8d6a3925d4fc237bdff4bfe078c886aa91194df713bf771?s=96&d=mm&r=g\",\"caption\":\"Ilija Eftimov\"},\"description\":\"Ilija is a full-stack Ruby on Rails developer working as a consultant at Siyelo. He loves experimenting with Ruby and Rails. Blogs regularly at rubylogs.com.\",\"sameAs\":[\"http:\/\/rubylogs.com\/\",\"https:\/\/x.com\/fteem\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/ilija-eftimov\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Build a Minimal Docker Container for Ruby Apps - Web Code Geeks - 2026","description":"As a Ruby and Rails developer, I\u2019ve always wanted to have a working and isolated environment for my projects, regardless if it\u2019s a client project, some","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/","og_locale":"en_US","og_type":"article","og_title":"Build a Minimal Docker Container for Ruby Apps - Web Code Geeks - 2026","og_description":"As a Ruby and Rails developer, I\u2019ve always wanted to have a working and isolated environment for my projects, regardless if it\u2019s a client project, some","og_url":"https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_published_time":"2015-07-28T13:15:26+00:00","article_modified_time":"2015-12-16T09:29:15+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg","type":"image\/jpeg"}],"author":"Ilija Eftimov","twitter_card":"summary_large_image","twitter_creator":"@fteem","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Ilija Eftimov","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/"},"author":{"name":"Ilija Eftimov","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/b0a347492d44c5dca7501616667317ff"},"headline":"Build a Minimal Docker Container for Ruby Apps","datePublished":"2015-07-28T13:15:26+00:00","dateModified":"2015-12-16T09:29:15+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/"},"wordCount":1507,"commentCount":0,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg","keywords":["Docker","Rails"],"articleSection":["Web Dev"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/","url":"https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/","name":"Build a Minimal Docker Container for Ruby Apps - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg","datePublished":"2015-07-28T13:15:26+00:00","dateModified":"2015-12-16T09:29:15+00:00","description":"As a Ruby and Rails developer, I\u2019ve always wanted to have a working and isolated environment for my projects, regardless if it\u2019s a client project, some","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/web-development\/build-minimal-docker-container-ruby-apps\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Web Dev","item":"https:\/\/www.webcodegeeks.com\/category\/web-development\/"},{"@type":"ListItem","position":3,"name":"Build a Minimal Docker Container for Ruby Apps"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/b0a347492d44c5dca7501616667317ff","name":"Ilija Eftimov","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/4e15cb15248ba112c8d6a3925d4fc237bdff4bfe078c886aa91194df713bf771?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4e15cb15248ba112c8d6a3925d4fc237bdff4bfe078c886aa91194df713bf771?s=96&d=mm&r=g","caption":"Ilija Eftimov"},"description":"Ilija is a full-stack Ruby on Rails developer working as a consultant at Siyelo. He loves experimenting with Ruby and Rails. Blogs regularly at rubylogs.com.","sameAs":["http:\/\/rubylogs.com\/","https:\/\/x.com\/fteem"],"url":"https:\/\/www.webcodegeeks.com\/author\/ilija-eftimov\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/6086","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/125"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=6086"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/6086\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/927"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=6086"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=6086"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=6086"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}