<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tomas Fernandez</title>
    <description>The latest articles on DEV Community by Tomas Fernandez (@tomsfernandez).</description>
    <link>https://dev.to/tomsfernandez</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F137795%2Fe787a124-0c85-44b6-8ba0-703f9b9ebb9a.jpeg</url>
      <title>DEV Community: Tomas Fernandez</title>
      <link>https://dev.to/tomsfernandez</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tomsfernandez"/>
    <language>en</language>
    <item>
      <title>Cypress testing with Rails API Backend</title>
      <dc:creator>Tomas Fernandez</dc:creator>
      <pubDate>Mon, 12 Aug 2019 01:09:26 +0000</pubDate>
      <link>https://dev.to/tomsfernandez/cypress-testing-with-rails-api-backend-1mh7</link>
      <guid>https://dev.to/tomsfernandez/cypress-testing-with-rails-api-backend-1mh7</guid>
      <description>&lt;p&gt;At one of our current projects we started testing our key functionalities with Cypress for our React front-end. As we started writing our tests we stumbled upon a problem, how could we have a clear and easy way to setup and clear the data created/modified in the test in a secure way?&lt;/p&gt;

&lt;p&gt;We couldn´t do it directly in our API as our front end is fed by several APIs. We also wanted our tests not to be written in Ruby so the &lt;a href="https://github.com/shakacode/cypress-on-rails" rel="noopener noreferrer"&gt;cypress-on-rails gem&lt;/a&gt; wasn't an option. &lt;/p&gt;

&lt;p&gt;Our main goal was to do this &lt;strong&gt;without having to add unwanted functionality to our Rails API&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Our first approach was to create a Rails controller that would only be enabled for Cypress testing. We chose to secure it via &lt;em&gt;environment&lt;/em&gt; variables and an authentication token.&lt;/p&gt;

&lt;p&gt;This option had one big &lt;strong&gt;pro&lt;/strong&gt;: it was very easy to create and easy to maintain, it was only a very big controller in the middle of our production code.&lt;/p&gt;

&lt;p&gt;Sadly, there were a number of drawbacks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Code meant as test helper was in the middle of the production and business code.&lt;/li&gt;
&lt;li&gt;We had to be really careful about the controller's security. Having a controller able to delete cascade several of our entities was a huge risk to have.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The last point was really important to us. A mistake in the APIs deployment could lead to someone wiping half of our database!.&lt;/p&gt;

&lt;p&gt;That's why we looked into another option: &lt;em&gt;using Rails engines&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;The pros:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Active Record models from our main app can be referenced from the engine.&lt;/li&gt;
&lt;li&gt;Endpoints used by Cypress won't be available in production.&lt;/li&gt;
&lt;li&gt;The code of the endpoints &lt;strong&gt;won't even be available in the production bundle&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This really lowered the chances that a mistake in deployment configuration left the endpoints available.&lt;/p&gt;

&lt;h2&gt;
  
  
  The code
&lt;/h2&gt;

&lt;p&gt;Lets create a new Rails project first:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;rails new cypress_api &lt;span class="nt"&gt;--api&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Inside our newly created API, lets create our Engine to declare our cypress-specific endpoints:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;rails plugin new cypress &lt;span class="nt"&gt;--mountable&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This will create a cypress folder at the root level with our new Rails engine and will also append the gem configuration in our main Gemfile. &lt;/p&gt;

&lt;p&gt;Run &lt;em&gt;bundle install&lt;/em&gt; and remove the TODOs from the engines gemspec to be able to start the app.&lt;/p&gt;

&lt;p&gt;Now, lets create a new controller inside the main app to signal the API is active. Write this code into app/controllers/status_controller.rb:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;StatusController&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;ActionController&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;API&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;status&lt;/span&gt;
    &lt;span class="n"&gt;render&lt;/span&gt; &lt;span class="ss"&gt;json: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"OK"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Let's do the same inside the engine, but with a different message. Inside cypress/app/controllers/cypress/status_controller.rb:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;module&lt;/span&gt; &lt;span class="nn"&gt;Cypress&lt;/span&gt;
  &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;StatusController&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;ActionController&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;API&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;status&lt;/span&gt;
      &lt;span class="n"&gt;render&lt;/span&gt; &lt;span class="ss"&gt;json: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Cypress OK"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Also, add the corresponding route config in config/routes.rb and cypress/config/routes.rb as well.&lt;/p&gt;

&lt;p&gt;Last, we have to mount our engine's endpoints to our main app. The thing is, we can't do that statically as we don't want the endpoints to be available at all times. We have to do it &lt;em&gt;dynamically&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;To do this, we have to add this snippet to the Engines main class in cypress/lib/cypress/engine.rb:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;  &lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cypress_engine&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;ActiveSupport&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;OrderedOptions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;
  &lt;span class="n"&gt;initializer&lt;/span&gt; &lt;span class="s1"&gt;'cypress_engine.configuration'&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cypress_engine&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:mounted_path&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
      &lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;routes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
        &lt;span class="n"&gt;mount&lt;/span&gt; &lt;span class="no"&gt;Cypress&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Engine&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cypress_engine&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:mounted_path&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
      &lt;span class="k"&gt;end&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;So what does this snippet do? If the &lt;em&gt;config.cypress_engine&lt;/em&gt; option is declared anywhere in our environment files or application file the engines endpoints will be appended to the main app with a prefix.&lt;/p&gt;

&lt;p&gt;For now, let's declare that option in our development.rb file.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt; &lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cypress_engine&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mounted_path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"/cypress"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;We are now declaring that our Cypress Engine endpoints will be mounted into our main app with the &lt;em&gt;cypress&lt;/em&gt; prefix.&lt;/p&gt;

&lt;p&gt;Let's try it out! Start Rails in development mode and access &lt;em&gt;"/status"&lt;/em&gt; and &lt;em&gt;"cypress/status"&lt;/em&gt;. We can see that both endpoints are available!.&lt;/p&gt;

&lt;p&gt;Now, lets start the app in production mode. If we try to access &lt;em&gt;"/cypress/status"&lt;/em&gt; we can see that 404 is returned.&lt;/p&gt;

&lt;p&gt;Great! Now the Cypress endpoints are not available in the production environment but is still bundled into our app. To omit adding the endpoints to our app while in production we can limit the Gem to only be installed while in development.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;  &lt;span class="n"&gt;group&lt;/span&gt; &lt;span class="ss"&gt;:cypress&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
    &lt;span class="n"&gt;gem&lt;/span&gt; &lt;span class="s2"&gt;"cypress"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;path: &lt;/span&gt;&lt;span class="s2"&gt;"cypress"&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;We can also add another level of security to our engine in case someone removes this config by mistake. &lt;/p&gt;

&lt;p&gt;Add this snippet to cypress/lib/cypress/engine.rb below what we previously added:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;  &lt;span class="n"&gt;initializer&lt;/span&gt; &lt;span class="s2"&gt;"cypress_engine.cypress_only"&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
    &lt;span class="k"&gt;unless&lt;/span&gt; &lt;span class="no"&gt;Rails&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;development?&lt;/span&gt;
      &lt;span class="nb"&gt;abort&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;-&lt;/span&gt;&lt;span class="no"&gt;END&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip_heredoc&lt;/span&gt;&lt;span class="sh"&gt;
        Cypress Engine is activated in the &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="no"&gt;Rails&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;env&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt; environment. This is
        usually a mistake. To ensure it's only activated in cypress
        mode, move it to the development group of your Gemfile:

            gem 'cypress', group: :development
&lt;/span&gt;&lt;span class="no"&gt;      END&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;If the cypress engine is used in an environment other than development, Rails startup will be aborted.&lt;/p&gt;

&lt;p&gt;You can find all the code in this repo:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/tomsfernandez" rel="noopener noreferrer"&gt;
        tomsfernandez
      &lt;/a&gt; / &lt;a href="https://github.com/tomsfernandez/Rails-Cypress-API-Example" rel="noopener noreferrer"&gt;
        Rails-Cypress-API-Example
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Example code of a Cypress setup for Rails API with Engines for Dev.to blog post
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="plain"&gt;&lt;pre&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/tomsfernandez/Rails-Cypress-API-Example" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;(In the repo a new environment called "cypress" exists to add another level of security but it isn't really necessary)&lt;/p&gt;

</description>
      <category>rails</category>
      <category>devops</category>
      <category>cypress</category>
    </item>
    <item>
      <title>Download Docker Images without Docker Pull</title>
      <dc:creator>Tomas Fernandez</dc:creator>
      <pubDate>Sun, 07 Jul 2019 16:09:41 +0000</pubDate>
      <link>https://dev.to/tomsfernandez/download-docker-images-without-docker-pull-17e6</link>
      <guid>https://dev.to/tomsfernandez/download-docker-images-without-docker-pull-17e6</guid>
      <description>&lt;p&gt;&lt;strong&gt;Docker pull&lt;/strong&gt; is the basic command for using Docker images. It works most of the time but sometimes it freezes in the middle of the download. Lots of people have raised issues about this with hacks that involve killing a process or restarting the docker-machine several times.&lt;/p&gt;

&lt;p&gt;All these hacks aren't an issue with small image sizes like the &lt;em&gt;alpine&lt;/em&gt; distribution or an &lt;em&gt;nginx&lt;/em&gt; image but, what about the large images? Images that weight like 500 MB or 2 GB?&lt;/p&gt;

&lt;p&gt;These hacks aren't useful because they involve downloading large layers over and over again.&lt;/p&gt;

&lt;p&gt;A better workaround is to download the images manually and load them to the docker-machine. This is a much better solution as the manual download has much lower chances to fail than restarting the docker-machine hoping that docker pull starts working.&lt;/p&gt;

&lt;p&gt;To download a docker image manually, there is a script called 'download-frozen-image-v2.sh' in the Moby project that lets us do that:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/moby/moby/blob/master/contrib/download-frozen-image-v2.sh" rel="noopener noreferrer"&gt;https://github.com/moby/moby/blob/master/contrib/download-frozen-image-v2.sh&lt;/a&gt;&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/moby" rel="noopener noreferrer"&gt;
        moby
      &lt;/a&gt; / &lt;a href="https://github.com/moby/moby" rel="noopener noreferrer"&gt;
        moby
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      The Moby Project - a collaborative project for the container ecosystem to assemble container-based systems
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;The Moby Project&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/moby/mobydocs/static_files/moby-project-logo.png"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fmoby%2Fmobydocs%2Fstatic_files%2Fmoby-project-logo.png" alt="Moby Project logo" title="The Moby Project"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Moby is an open-source project created by Docker to enable and accelerate software containerization.&lt;/p&gt;
&lt;p&gt;It provides a "Lego set" of toolkit components, the framework for assembling them into custom container-based systems, and a place for all container enthusiasts and professionals to experiment and exchange ideas
Components include container build tools, a container registry, orchestration tools, a runtime and more, and these can be used as building blocks in conjunction with other tools and projects.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Principles&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;Moby is an open project guided by strong principles, aiming to be modular, flexible and without too strong an opinion on user experience.
It is open to the community to help set its direction.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Modular: the project includes lots of components that have well-defined functions and APIs that work together.&lt;/li&gt;
&lt;li&gt;Batteries included but swappable: Moby includes enough components to build fully featured container systems, but its modular architecture ensures that most of…&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/moby/moby" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;This script only needs three things installed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Curl&lt;/li&gt;
&lt;li&gt;Jq&lt;/li&gt;
&lt;li&gt;Go&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To use the script we only need to specify the image to download and the location relative to the current:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="nv"&gt;$ &lt;/span&gt;./download-frozen-image-v2.sh &lt;span class="s2"&gt;"example"&lt;/span&gt; hello-world:latest


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;In this example we are downloading the image "hello-world:latest" in the "example" directory.&lt;/p&gt;

&lt;p&gt;Note: be sure to specify the version tag. If not specified, the script will return Not Found (404)&lt;/p&gt;

&lt;p&gt;This will download several files into the "example" directory:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;manifest.json&lt;/li&gt;
&lt;li&gt;repositories file&lt;/li&gt;
&lt;li&gt;json with details of the image&lt;/li&gt;
&lt;li&gt;folder for each layer in the image&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The only thing next to do is load it into the docker-machine. The script outputs the command necessary to do it:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;tar&lt;/span&gt; &lt;span class="nt"&gt;-cC&lt;/span&gt; &lt;span class="s1"&gt;'example'&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt; | docker load
af0b15c8625b: Loading layer &lt;span class="o"&gt;[==================================================&amp;gt;]&lt;/span&gt;     977B/977B
Loaded image: hello-world:latest


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Congratulations&lt;/strong&gt;! You have pulled a docker image without the &lt;em&gt;docker pull&lt;/em&gt; command!&lt;/p&gt;

</description>
      <category>docker</category>
      <category>devops</category>
      <category>scripts</category>
      <category>hacks</category>
    </item>
  </channel>
</rss>
