Skip to content

Commit f2d79ae

Browse files
committed
Use gzip instead of bzip2
1 parent 4e225b9 commit f2d79ae

33 files changed

+13
-14
lines changed

.docker/Dockerfile-centos_6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM centos:6
22

3-
RUN yum install -y ruby libjpeg-turbo libpng libXrender fontconfig libXext bzip2
3+
RUN yum install -y ruby libjpeg-turbo libpng libXrender fontconfig libXext
44

55
CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version

.docker/Dockerfile-centos_7

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM centos:7
22

3-
RUN yum install -y ruby libjpeg-turbo libpng libXrender fontconfig libXext bzip2
3+
RUN yum install -y ruby libjpeg-turbo libpng libXrender fontconfig libXext
44

55
CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version

.docker/Dockerfile-debian_8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ FROM debian:8
33
ENV DEBIAN_FRONTEND noninteractive
44

55
RUN apt-get update
6-
RUN apt-get install -y ruby libjpeg62-turbo libpng12-0 libxrender1 libfontconfig1 libxext6 bzip2
6+
RUN apt-get install -y ruby libjpeg62-turbo libpng12-0 libxrender1 libfontconfig1 libxext6
77

88
CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version

.docker/Dockerfile-debian_9

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ FROM debian:9
33
ENV DEBIAN_FRONTEND noninteractive
44

55
RUN apt-get update
6-
RUN apt-get install -y ruby libjpeg62-turbo libpng16-16 libxrender1 libfontconfig1 libxext6 bzip2
6+
RUN apt-get install -y ruby libjpeg62-turbo libpng16-16 libxrender1 libfontconfig1 libxext6
77

88
CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version

.docker/Dockerfile-ubuntu_14.04

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ FROM ubuntu:14.04
33
ENV DEBIAN_FRONTEND noninteractive
44

55
RUN apt-get update
6-
RUN apt-get install -y ruby libjpeg8 libxrender1 libfontconfig1 bzip2
6+
RUN apt-get install -y ruby libjpeg8 libxrender1 libfontconfig1
77

88
CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version

.docker/Dockerfile-ubuntu_16.04

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ FROM ubuntu:16.04
33
ENV DEBIAN_FRONTEND noninteractive
44

55
RUN apt-get update
6-
RUN apt-get install -y ruby libjpeg8 libxrender1 libfontconfig1 bzip2
6+
RUN apt-get install -y ruby libjpeg8 libxrender1 libfontconfig1
77

88
CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version

.docker/Dockerfile-ubuntu_18.04

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ FROM ubuntu:18.04
33
ENV DEBIAN_FRONTEND noninteractive
44

55
RUN apt-get update
6-
RUN apt-get install -y ruby libjpeg8 libxrender1 libfontconfig1 bzip2
6+
RUN apt-get install -y ruby libjpeg8 libxrender1 libfontconfig1
77

88
CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ macOS
1919

2020
## Compression
2121

22-
Binaries should be compressed with `bzip2 -9` after extracting. The matching binary will be extracted on first
22+
Binaries should be compressed with `gzip --best` after extracting. The matching binary will be extracted on first
2323
execution of `bin/wkhtmltopdf`.
2424

2525
## Testing with Docker

bin/wkhtmltopdf

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# of the License at http://www.apache.org/licenses/LICENSE-2.0
99

1010
require 'rbconfig'
11+
require 'zlib'
1112

1213
suffix = case RbConfig::CONFIG['host_os']
1314
when /linux/
@@ -29,12 +30,10 @@ suffix = case RbConfig::CONFIG['host_os']
2930

3031
binary = "#{__FILE__}_#{suffix}"
3132

32-
if File.exist?("#{binary}.bz2") && !File.exist?(binary)
33-
# There was an error on macOS when a hard link to the archive exists (could be
34-
# Time Machine). Even with `--keep` it states: 'Input file has 1 other link'.
35-
# Using `--force` fixes this.
36-
system("bzip2 --decompress --keep --force #{binary}.bz2") ||
37-
raise("Decompression of #{binary}.bz2 failed. Do you have bzip2 installed?")
33+
if File.exist?("#{binary}.gz") && !File.exist?(binary)
34+
File.open binary, 'wb', 0o755 do |file|
35+
Zlib::GzipReader.open("#{binary}.gz") { |gzip| file << gzip.read }
36+
end
3837
end
3938

4039
unless File.exist? binary

bin/wkhtmltopdf_centos_6_amd64.bz2

-12.1 MB
Binary file not shown.

0 commit comments

Comments
 (0)