Skip to content

Commit 2285462

Browse files
committed
Intel QAT Support
1 parent 2a2ec19 commit 2285462

1 file changed

Lines changed: 31 additions & 16 deletions

File tree

Dockerfile

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ ENV PATH=$JAVA_HOME/bin:$PATH
4040
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
4141

4242
RUN DEBIAN_FRONTEND=noninteractive apt-get update; \
43-
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata curl wget ca-certificates fontconfig locales binutils lsof curl openssl git tar sqlite3 libfreetype6 iproute2 libstdc++6 libmimalloc3 git-lfs tini zip unzip jq valkey-tools; \
43+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata curl wget ca-certificates fontconfig locales binutils lsof curl openssl git tar sqlite3 libfreetype6 iproute2 libstdc++6 libmimalloc3 git-lfs tini zip unzip jq valkey-tools qatengine; \
4444
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; \
4545
locale-gen en_US.UTF-8; \
4646
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y; \
@@ -52,39 +52,54 @@ COPY --from=builder /usr/local/include/zlib.h /usr/local/include/zconf.h /usr/lo
5252
COPY --from=builder /usr/local/lib/pkgconfig/zlib.pc /usr/lib64/pkgconfig/
5353

5454
RUN set -eux; \
55-
wget -O /tmp/graalvm.tar.gz https://download.oracle.com/graalvm/${JDK_VERSION}/latest/graalvm-jdk-${JDK_VERSION}_linux-x64_bin.tar.gz; \
56-
wget -O /tmp/graalvm.tar.gz.sha256 https://download.oracle.com/graalvm/${JDK_VERSION}/latest/graalvm-jdk-${JDK_VERSION}_linux-x64_bin.tar.gz.sha256; \
57-
ESUM=$(cat /tmp/graalvm.tar.gz.sha256); \
58-
echo "${ESUM} */tmp/graalvm.tar.gz" | sha256sum -c -; \
59-
mkdir -p "$JAVA_HOME"; \
60-
tar --extract \
61-
--file /tmp/graalvm.tar.gz \
62-
--directory "$JAVA_HOME" \
63-
--strip-components 1 \
64-
--no-same-owner \
65-
; \
55+
wget -O /tmp/graalvm.tar.gz https://download.oracle.com/graalvm/${JDK_VERSION}/latest/graalvm-jdk-${JDK_VERSION}_linux-x64_bin.tar.gz; \
56+
wget -O /tmp/graalvm.tar.gz.sha256 https://download.oracle.com/graalvm/${JDK_VERSION}/latest/graalvm-jdk-${JDK_VERSION}_linux-x64_bin.tar.gz.sha256; \
57+
ESUM=$(cat /tmp/graalvm.tar.gz.sha256); \
58+
echo "${ESUM} */tmp/graalvm.tar.gz" | sha256sum -c -; \
59+
mkdir -p "$JAVA_HOME"; \
60+
tar --extract \
61+
--file /tmp/graalvm.tar.gz \
62+
--directory "$JAVA_HOME" \
63+
--strip-components 1 \
64+
--no-same-owner \
65+
; \
6666
rm -f /tmp/graalvm.tar.gz /tmp/graalvm.tar.gz.sha256 ${JAVA_HOME}/lib/src.zip; \
6767
# https://github.com/docker-library/openjdk/issues/331#issuecomment-498834472
6868
JAVA_VERSION=$(sed -n '/^JAVA_VERSION="/{s///;s/"//;p;}' "$JAVA_HOME"/release); \
6969
find "$JAVA_HOME/lib" -name '*.so' -exec dirname '{}' ';' | sort -u > /etc/ld.so.conf.d/docker-openjdk.conf; \
7070
ldconfig; \
7171
# https://github.com/docker-library/openjdk/issues/212#issuecomment-420979840
7272
# https://openjdk.java.net/jeps/341
73-
java -Xshare:dump;
73+
java -Xshare:dump; \
74+
# Create QAT OpenSSL config
75+
echo 'openssl_conf = openssl_init\n\
76+
\n\
77+
[ openssl_init ]\n\
78+
engines = engine_section\n\
79+
\n\
80+
[ engine_section ]\n\
81+
qat = qat_section\n\
82+
\n\
83+
[ qat_section ]\n\
84+
engine_id = qatengine\n\
85+
default_algorithms = ALL' > /etc/ssl/openssl_qat.cnf
7486

7587
## Setup user and working directory
7688
RUN useradd -m -d /home/container -s /bin/bash container
7789
USER container
78-
ENV USER=container HOME=/home/container LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libmimalloc.so.3.0 MIMALLOC_ALLOW_LARGE_OS_PAGES=1 MIMALLOC_PURGE_DELAY=100
90+
ENV USER=container HOME=/home/container LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libmimalloc.so.3.0 MIMALLOC_ALLOW_LARGE_OS_PAGES=1 MIMALLOC_PURGE_DELAY=100 OPENSSL_CONF=/etc/ssl/openssl_qat.cnf
7991
WORKDIR /home/container
8092

81-
8293
RUN echo Verifying install ...; \
8394
fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \
84-
echo javac --version; \
95+
echo javac --version; \
8596
javac --version; \
8697
echo java --version; \
8798
java --version; \
99+
echo openssl version; \
100+
openssl version; \
101+
echo checking openssl engine; \
102+
openssl engine -t -c -v qat; \
88103
echo Complete.
89104

90105
STOPSIGNAL SIGINT

0 commit comments

Comments
 (0)