lib/getv/package.rb in getv-1.3.1 vs lib/getv/package.rb in getv-1.4.0

- old
+ new

@@ -87,12 +87,18 @@ opts[:latest_version] = opts[:versions][-1] unless opts[:versions].empty? end private - def versions_using_docker + def versions_using_docker # rubocop:disable Metrics/AbcSize require 'docker_registry2' - docker = DockerRegistry2.connect(opts[:url]) + docker_opts = {} + docker_opts[:http_options] = { proxy: ENV['DOCKER_PROXY'] } if ENV['DOCKER_PROXY'] + if ENV['DOCKER_USER'] && ENV['DOCKER_PASSWORD'] + docker_opts[:user] = ENV['DOCKER_USER'] + docker_opts[:password] = ENV['DOCKER_PASSWORD'] + end + docker = DockerRegistry2.connect(opts[:url], docker_opts) docker.tags("#{opts[:owner]}/#{opts[:repo]}")['tags'] end def versions_using_gem require 'json'