Skip to content

Commit 312737b

Browse files
committed
expand check to match Rails generated Dockerfiles
An example: ``` ARG RUBY_VERSION=3.4.2 FROM docker.io/library/ruby:$RUBY_VERSION-slim AS base ```
1 parent 8449fc5 commit 312737b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/generators/dockerfile_generator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ def generate_app
418418
# Older versions no longer release new images
419419
matching_ruby = [">= 3.4.2", "~> 3.3.7", "~> 3.2.7", "~> 3.1.7"].any? { |v| Gem::Requirement.new(v).satisfied_by?(Gem.ruby_version) }
420420
# Only slim and alpine are missing libyaml-dev/yaml-dev
421-
matching_image = /FROM ruby:.+-(alpine|slim)/i.match?(dockerfile)
421+
matching_image = /FROM .*ruby:.+-(alpine|slim)/i.match?(dockerfile)
422422
if !matching_ruby || !matching_image
423423
missing.delete("libyaml-dev")
424424
missing.delete("yaml-dev")

0 commit comments

Comments
 (0)