Skip to content

Commit

Permalink
Fix#13342 adapt docker provider build for containerd storage
Browse files Browse the repository at this point in the history
  • Loading branch information
tnaroska committed Jan 28, 2024
1 parent d8fdc50 commit ce15776
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugins/providers/docker/driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ def build(dir, **opts, &block)
# In this case, docker buildkit is enabled. Its format is different
# from standard docker
matches = result.scan(/writing image .+:([^\s]+)/i).last
if !matches
# Check for outout of docker using containerd backend store
matches = result.scan(/exporting manifest list .+:([^\s]+)/i).last
end
if !matches
if podman?
# Check for podman format when it is emulating docker CLI.
Expand Down
10 changes: 10 additions & 0 deletions test/unit/plugins/providers/docker/driver_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,16 @@
end
end

context "using buildkit with containerd backend output" do
let(:stdout) { "exporting manifest list sha256:1a2b3c4d done" }

it "builds a container with buildkit docker (containerd)" do
container_id = subject.build("/tmp/fakedir")

expect(container_id).to eq(cid)
end
end

context "using podman emulating docker CLI" do
let(:stdout) { "1a2b3c4d5e6f7g8h9i10j11k12l13m14n16o17p18q19r20s21t22u23v24w25x2" }

Expand Down

0 comments on commit ce15776

Please sign in to comment.