fix: export docker.{containers,images,volumes} "barel" method
+ 11
- 8
src/docker/api/images.cr
@@ -72,10 +72,9 @@ module Docker::Api::Images
   # Identical to the `docker pull` command.
   def pull_image(name : String, tag : String? = nil)
     params = HTTP::Params.build do |param|
-      param.add "name", name
+      param.add "fromImage", name
       param.add "tag", tag.to_s unless tag.nil?
     end
     response = get "/images/create?#{params}"
-
   end
 end

@@ -16,13 +16,17 @@ class Docker::Client
     @client = Docker::Api::ApiClient.new base_url, @api_version
   end
 
-  {% for component in %w(containers images) %}
-    # Provide an object for managing {{component.id}}. See `Docker::{{component.id.capitalize}}`.
-    def {{component.id}} : {{component.id.capitalize}}
-      @{{component.id}} ||= {{component.id.capitalize}}.new client
-    end
-  {% end %}
+  # Provides access to container management.
+  def containers
+    Containers.new @client
+  end
+
+  # Provides access to image management.
+  def images
+    Images.new @client
+  end
 
+  # Provides access to volume management.
   def volumes
     Volumes.new @client
   end