Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['3.0', '3.1', '3.2', '3.3']
ruby-version: ['3.2', '3.3', '3.4', '4.0']
steps:
- name: checkout
uses: actions/checkout@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: actions/checkout@v1
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
ruby-version: 3.4
- name: test
run: make build test BUILD=local
- name: report gemfile name
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
ruby-version: 3.4


- name: Run rubocop
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['3.0', '3.1', '3.2', '3.3']
ruby-version: ['3.2', '3.3', '3.4', '4.0']
registry-version: ['v1', 'v2']
steps:
- name: Setup ruby
Expand Down
33 changes: 30 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,31 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['3.0', '3.1', '3.2', '3.3']
registry-version: ['v1', 'v2']
include:
- ruby-version: '3.2'
fixture-schema: 'v1'
registry-image: 'registry:2.8.3'
- ruby-version: '3.2'
fixture-schema: 'v2'
registry-image: 'registry'
- ruby-version: '3.3'
fixture-schema: 'v1'
registry-image: 'registry:2.8.3'
- ruby-version: '3.3'
fixture-schema: 'v2'
registry-image: 'registry'
- ruby-version: '3.4'
fixture-schema: 'v1'
registry-image: 'registry:2.8.3'
- ruby-version: '3.4'
fixture-schema: 'v2'
registry-image: 'registry'
- ruby-version: '4.0'
fixture-schema: 'v1'
registry-image: 'registry:2.8.3'
- ruby-version: '4.0'
fixture-schema: 'v2'
registry-image: 'registry'
steps:
- name: Setup ruby
uses: ruby/setup-ruby@v1
Expand All @@ -25,14 +48,18 @@ jobs:
uses: actions/checkout@v1

- name: Start containers
env:
REGISTRY_IMAGE: ${{ matrix.registry-image }}
run: docker compose -f "docker-compose.yml" up -d --build

- name: bundle install
run: bundle install

- name: Run tests
run: REGISTRY=http://localhost:5000 VERSION=${{ matrix.registry-version }} ruby ./test/test.rb
run: REGISTRY=http://localhost:5000 VERSION=${{ matrix.fixture-schema }} ruby ./test/test.rb

- name: Stop containers
if: always()
env:
REGISTRY_IMAGE: ${{ matrix.registry-image }}
run: docker compose -f "docker-compose.yml" down
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## v1.19.0, 19 March 2026

- Replace the `rest-client` transport with Faraday while keeping `http_options`
compatibility for proxy, timeout, SSL, and mTLS settings
- Follow redirects for blob downloads and tag writes without forwarding
authorization headers across hosts
- Retry manifest requests with the legacy schema-v1 Accept header when newer
registries return HTTP 500 for legacy manifests
- Raise `DockerRegistry2::RegistryHTTPException` for unexpected HTTP errors
instead of attempting to parse error responses as registry payloads
- Update the development and CI matrix to Ruby 3.2 through 4.0, and pin
schema-v1 integration coverage to `registry:2.8.3`

## v1.7.1, 13 July 2019

- Add `application/json` to the list of acceptable response formats from
Expand Down Expand Up @@ -39,4 +52,3 @@
- Move `ping` call from `DockerRegistry2::Registry.new` to
`DockerRegistry2.connect`, to allow a registry to be initialized without a
ping.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# build container
ARG IMG=ruby:3.1.1-alpine
ARG IMG=ruby:3.4.9-alpine
FROM ${IMG} AS build

RUN apk --update add make
Expand Down
155 changes: 106 additions & 49 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,86 +2,100 @@ PATH
remote: .
specs:
docker_registry2 (1.18.2)
rest-client (>= 1.8.0)
faraday (>= 2.0)
faraday-follow_redirects
faraday-net_http

GEM
remote: https://rubygems.org/
specs:
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
ast (2.4.2)
bigdecimal (3.1.8)
crack (1.0.0)
addressable (2.8.9)
public_suffix (>= 2.0.2, < 8.0)
ast (2.4.3)
base64 (0.3.0)
benchmark (0.5.0)
bigdecimal (4.0.1)
crack (1.0.1)
bigdecimal
rexml
diff-lcs (1.5.1)
domain_name (0.6.20240107)
hashdiff (1.1.0)
http-accept (1.7.0)
http-cookie (1.0.6)
domain_name (~> 0.5)
json (2.7.2)
language_server-protocol (3.17.0.3)
mime-types (3.5.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2024.0702)
netrc (0.11.0)
parallel (1.25.1)
parser (3.3.4.0)
diff-lcs (1.6.2)
faraday (2.14.1)
faraday-net_http (>= 2.0, < 3.5)
json
logger
faraday-follow_redirects (0.5.0)
faraday (>= 1, < 3)
faraday-net_http (3.4.2)
net-http (~> 0.5)
hashdiff (1.2.1)
json (2.19.1)
json-schema (6.2.0)
addressable (~> 2.8)
bigdecimal (>= 3.1, < 5)
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
logger (1.7.0)
mcp (0.8.0)
json-schema (>= 4.1)
net-http (0.9.1)
uri (>= 0.11.1)
parallel (1.27.0)
parser (3.3.10.2)
ast (~> 2.4.1)
racc
public_suffix (6.0.1)
prism (1.9.0)
public_suffix (7.0.5)
racc (1.8.1)
rainbow (3.1.1)
rake (13.2.1)
regexp_parser (2.9.2)
rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.3.6)
strscan
rspec (3.13.0)
rake (13.3.1)
regexp_parser (2.11.3)
rexml (3.4.4)
rspec (3.13.2)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.0)
rspec-core (3.13.6)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.1)
rspec-expectations (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.1)
rspec-mocks (3.13.8)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
rubocop (1.65.1)
rspec-support (3.13.7)
rubocop (1.85.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
mcp (~> 0.6)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.4, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.31.1, < 2.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.49.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.3)
parser (>= 3.3.1.0)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.49.1)
parser (>= 3.3.7.2)
prism (~> 1.7)
ruby-progressbar (1.13.0)
strscan (3.1.0)
unicode-display_width (2.5.0)
vcr (6.2.0)
webmock (3.23.1)
unicode-display_width (3.2.0)
unicode-emoji (~> 4.1)
unicode-emoji (4.2.0)
uri (1.1.1)
vcr (6.4.0)
webmock (3.26.2)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)

PLATFORMS
arm64-darwin-22
ruby
x86_64-linux

DEPENDENCIES
base64
benchmark
bundler
docker_registry2!
rake (~> 13.0)
Expand All @@ -90,5 +104,48 @@ DEPENDENCIES
vcr (~> 6)
webmock

CHECKSUMS
addressable (2.8.9) sha256=cc154fcbe689711808a43601dee7b980238ce54368d23e127421753e46895485
ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
benchmark (0.5.0) sha256=465df122341aedcb81a2a24b4d3bd19b6c67c1530713fd533f3ff034e419236c
bigdecimal (4.0.1) sha256=8b07d3d065a9f921c80ceaea7c9d4ae596697295b584c296fe599dd0ad01c4a7
crack (1.0.1) sha256=ff4a10390cd31d66440b7524eb1841874db86201d5b70032028553130b6d4c7e
diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
docker_registry2 (1.18.2)
faraday (2.14.1) sha256=a43cceedc1e39d188f4d2cdd360a8aaa6a11da0c407052e426ba8d3fb42ef61c
faraday-follow_redirects (0.5.0) sha256=5cde93c894b30943a5d2b93c2fe9284216a6b756f7af406a1e55f211d97d10ad
faraday-net_http (3.4.2) sha256=f147758260d3526939bf57ecf911682f94926a3666502e24c69992765875906c
hashdiff (1.2.1) sha256=9c079dbc513dfc8833ab59c0c2d8f230fa28499cc5efb4b8dd276cf931457cd1
json (2.19.1) sha256=dd94fdc59e48bff85913829a32350b3148156bc4fd2a95a2568a78b11344082d
json-schema (6.2.0) sha256=e8bff46ed845a22c1ab2bd0d7eccf831c01fe23bb3920caa4c74db4306813666
language_server-protocol (3.17.0.5) sha256=fd1e39a51a28bf3eec959379985a72e296e9f9acfce46f6a79d31ca8760803cc
lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
mcp (0.8.0) sha256=ae8bd146bb8e168852866fd26f805f52744f6326afb3211e073f78a95e0c34fb
net-http (0.9.1) sha256=25ba0b67c63e89df626ed8fac771d0ad24ad151a858af2cc8e6a716ca4336996
parallel (1.27.0) sha256=4ac151e1806b755fb4e2dc2332cbf0e54f2e24ba821ff2d3dcf86bf6dc4ae130
parser (3.3.10.2) sha256=6f60c84aa4bdcedb6d1a2434b738fe8a8136807b6adc8f7f53b97da9bc4e9357
prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85
public_suffix (7.0.5) sha256=1a8bb08f1bbea19228d3bed6e5ed908d1cb4f7c2726d18bd9cadf60bc676f623
racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
rake (13.3.1) sha256=8c9e89d09f66a26a01264e7e3480ec0607f0c497a861ef16063604b1b08eb19c
regexp_parser (2.11.3) sha256=ca13f381a173b7a93450e53459075c9b76a10433caadcb2f1180f2c741fc55a4
rexml (3.4.4) sha256=19e0a2c3425dfbf2d4fc1189747bdb2f849b6c5e74180401b15734bc97b5d142
rspec (3.13.2) sha256=206284a08ad798e61f86d7ca3e376718d52c0bc944626b2349266f239f820587
rspec-core (3.13.6) sha256=a8823c6411667b60a8bca135364351dda34cd55e44ff94c4be4633b37d828b2d
rspec-expectations (3.13.5) sha256=33a4d3a1d95060aea4c94e9f237030a8f9eae5615e9bd85718fe3a09e4b58836
rspec-mocks (3.13.8) sha256=086ad3d3d17533f4237643de0b5c42f04b66348c28bf6b9c2d3f4a3b01af1d47
rspec-support (3.13.7) sha256=0640e5570872aafefd79867901deeeeb40b0c9875a36b983d85f54fb7381c47c
rubocop (1.85.1) sha256=3dbcf9e961baa4c376eeeb2a03913dca5e3987033b04d38fa538aa1e7406cc77
rubocop-ast (1.49.1) sha256=4412f3ee70f6fe4546cc489548e0f6fcf76cafcfa80fa03af67098ffed755035
ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42
unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f
uri (1.1.1) sha256=379fa58d27ffb1387eaada68c749d1426738bd0f654d812fcc07e7568f5c57c6
vcr (6.4.0) sha256=077ac92cc16efc5904eb90492a18153b5e6ca5398046d8a249a7c96a9ea24ae6
webmock (3.26.2) sha256=774556f2ea6371846cca68c01769b2eac0d134492d21f6d0ab5dd643965a4c90

BUNDLED WITH
2.2.3
4.0.8
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ opts = { open_timeout: 2, read_timeout: 5 }
reg = DockerRegistry2.connect("https://my.registy.corp.com", opts)
```

Your may pass extra options for RestClient::Request.execute through `http_options` :
You may pass extra Faraday connection options through `http_options`:

```ruby
opts = { http_options: { proxy: 'http://proxy.example.com:8080/' } }
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '2.4'
services:
registry:
restart: always
image: registry
image: ${REGISTRY_IMAGE:-registry:2.8.3}
ports:
- 5000:5000
environment:
Expand Down
6 changes: 5 additions & 1 deletion docker_registry2.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.require_paths = ['lib']

spec.add_development_dependency 'base64'
spec.add_development_dependency 'benchmark'
spec.add_development_dependency 'bundler'
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rspec', '~> 3'
spec.add_development_dependency 'rubocop', '>= 1.63.0'
spec.add_development_dependency 'vcr', '~> 6'
spec.add_development_dependency 'webmock'

spec.add_dependency 'rest-client', '>= 1.8.0'
spec.add_dependency 'faraday', '>= 2.0'
spec.add_dependency 'faraday-follow_redirects'
spec.add_dependency 'faraday-net_http'
spec.metadata['rubygems_mfa_required'] = 'true'
end
3 changes: 3 additions & 0 deletions lib/registry/exceptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,7 @@ class NotFound < DockerRegistry2::Exception

class InvalidMethod < DockerRegistry2::Exception
end

class RegistryHTTPException < DockerRegistry2::Exception
end
end
Loading
Loading