Skip to content
Open
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
5 changes: 5 additions & 0 deletions .docker/Dockerfile-almalinux_10
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM almalinux/almalinux:10

RUN yum install -y ruby libjpeg-turbo libpng libXrender fontconfig libXext

CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version
5 changes: 5 additions & 0 deletions .docker/Dockerfile-almalinux_9
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM almalinux/almalinux:9

RUN yum install -y ruby libjpeg-turbo libpng libXrender fontconfig libXext

CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version
5 changes: 5 additions & 0 deletions .docker/Dockerfile-fedora
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM fedora:42

RUN dnf install -y ruby libjpeg-turbo libpng libXrender fontconfig libXext

CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version
5 changes: 5 additions & 0 deletions .docker/Dockerfile-rockylinux_10
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM rockylinux/rockylinux:10

RUN yum install -y ruby libjpeg-turbo libpng libXrender fontconfig libXext

CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version
5 changes: 5 additions & 0 deletions .docker/Dockerfile-rockylinux_9
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM rockylinux/rockylinux:9

RUN yum install -y ruby libjpeg-turbo libpng libXrender fontconfig libXext

CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version
21 changes: 20 additions & 1 deletion bin/wkhtmltopdf
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,24 @@ suffix = case RbConfig::CONFIG['host_os']
os.start_with?('alinux_') ||
os == 'amzn_2023'

# RHEL 9/10 and their clones (Rocky, AlmaLinux, Oracle, CentOS Stream),
# plus modern Fedora, ship OpenSSL 3 and a newer glibc, so the Debian 12
# binary (which links libssl.so.3) runs on them while the CentOS 8 binary
# (OpenSSL 1.1) does not. See issues #191 (RHEL/Rocky 9), #169 (CentOS
# Stream 9) and #182 (Fedora) at
# https://github.com/zakird/wkhtmltopdf_binary_gem/issues
os = 'debian_12' if os.start_with?('almalinux_9') ||
os.start_with?('almalinux_10') ||
os.start_with?('centos_9') ||
os.start_with?('centos_10') ||
os.start_with?('fedora') ||
os.start_with?('ol_9.') ||
os.start_with?('ol_10.') ||
os.start_with?('rhel_9.') ||
os.start_with?('rhel_10.') ||
os.start_with?('rocky_9') ||
os.start_with?('rocky_10')

os_based_on_debian_9 = os.start_with?('debian_9') ||
os.start_with?('deepin')
os = 'debian_9' if os_based_on_debian_9
Expand Down Expand Up @@ -96,7 +114,8 @@ end

unless File.exist? binary
raise 'Invalid platform, must be running on Ubuntu 16.04/18.04/20.04/22.04, ' \
'CentOS 6/7/8, Debian 9/10/11/12, Archlinux amd64, Debian 9/10/11/12 arm64, or Intel-based Cocoa macOS ' \
'CentOS 6/7/8, RHEL/Rocky/AlmaLinux 8/9/10, Fedora, Debian 9/10/11/12/13, Archlinux amd64, ' \
'Debian 9/10/11/12 arm64, or Intel-based Cocoa macOS ' \
"(missing binary: #{binary})."
end

Expand Down
35 changes: 35 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,41 @@ services:
volumes:
- .:/root/wkhtmltopdf_binary_gem

almalinux_9:
build:
context: .
dockerfile: .docker/Dockerfile-almalinux_9
volumes:
- .:/root/wkhtmltopdf_binary_gem

almalinux_10:
build:
context: .
dockerfile: .docker/Dockerfile-almalinux_10
volumes:
- .:/root/wkhtmltopdf_binary_gem

fedora:
build:
context: .
dockerfile: .docker/Dockerfile-fedora
volumes:
- .:/root/wkhtmltopdf_binary_gem

rockylinux_9:
build:
context: .
dockerfile: .docker/Dockerfile-rockylinux_9
volumes:
- .:/root/wkhtmltopdf_binary_gem

rockylinux_10:
build:
context: .
dockerfile: .docker/Dockerfile-rockylinux_10
volumes:
- .:/root/wkhtmltopdf_binary_gem

archlinux:
build:
context: .
Expand Down
20 changes: 20 additions & 0 deletions test/test_with_docker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,26 @@ def test_almalinux_8
test_on_x86 with: 'almalinux_8'
end

def test_almalinux_9
test_on_x86 with: 'almalinux_9'
end

def test_almalinux_10
test_on_x86 with: 'almalinux_10'
end

def test_fedora
test_on_x86 with: 'fedora'
end

def test_rockylinux_9
test_on_x86 with: 'rockylinux_9'
end

def test_rockylinux_10
test_on_x86 with: 'rockylinux_10'
end

def test_with_macos
assert_equal('wkhtmltopdf 0.12.6 (with patched qt)', `bin/wkhtmltopdf --version`.strip) if macos?
end
Expand Down