dbeaver/dbeaver devops#1201 base java image (#2642)

* dbeaver/dbeaver-devops#1201 Base Java image

* dbeaver/dbeaver-devops#1201 Fix scripts

* dbeaver/dbeaver-devops#1201 hilevel default env var

---------

Co-authored-by: mayerro <roman.kunitskiy@gmail.com>
This commit is contained in:
Serge Rider
2024-05-20 16:44:25 +02:00
committed by GitHub
co-authored by mayerro
parent eaf19cf1d2
commit 7cd22a84c2
4 changed files with 14 additions and 9 deletions
+47
View File
@@ -0,0 +1,47 @@
FROM ubuntu:23.10
MAINTAINER DBeaver Corp, devops@dbeaver.com
ENV DEBIAN_FRONTEND=noninteractive
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
# curl required for historical reasons, see https://github.com/adoptium/containers/issues/255
curl \
wget \
# java.lang.UnsatisfiedLinkError: libfontmanager.so: libfreetype.so.6: cannot open shared object file: No such file or directory
# java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11FontManager
# https://github.com/docker-library/openjdk/pull/235#issuecomment-424466077
fontconfig \
# utilities for keeping Ubuntu and OpenJDK CA certificates in sync
# https://github.com/adoptium/containers/issues/293
ca-certificates p11-kit \
# jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351
# Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory
binutils \
tzdata \
# locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8
locales \
nano \
; \
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; \
locale-gen en_US.UTF-8; \
rm -rf /var/lib/apt/lists/*
ENV LANG=en_US.UTF-8
ENV JAVA_HOME=/opt/java/openjdk
COPY --from=eclipse-temurin:17 $JAVA_HOME $JAVA_HOME
ENV PATH="${JAVA_HOME}/bin:${PATH}"
RUN set -eux; \
# https://github.com/docker-library/openjdk/issues/331#issuecomment-498834472
find "$JAVA_HOME/lib" -name '*.so' -exec dirname '{}' ';' | sort -u > /etc/ld.so.conf.d/docker-openjdk.conf; \
ldconfig; \
# https://github.com/docker-library/openjdk/issues/212#issuecomment-420979840
# https://openjdk.java.net/jeps/341
java -Xshare:dump;
### Patch java security
COPY java.security* ${JAVA_HOME}/conf/security/java.security