Skip to content

Commit

Permalink
extra image temp fix for py3.12 lz4, more temurin attemps
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallen-Breath committed Dec 28, 2023
1 parent 2579d40 commit 213fa70
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Docker images
run-name: Images CI for "${{ inputs.base_image_tags || github.event.client_payload.base_image_tags }}"
run-name: Images CI for "${{ inputs.base_image_tags || github.event.client_payload.base_image_tags }}" ref ${{ github.event.client_payload.git_ref || 'N/A' }}

on:
workflow_dispatch:
Expand Down
8 changes: 8 additions & 0 deletions src/Dockerfile-extra
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ set -e
# disable the pip config temporary to install packages to the global storage
export PIP_CONFIG_FILE=/dev/null

if python3 -V 2>&1 | grep -q "3.12."; then
if ! command -v gcc &> /dev/null; then
# lz4 doesn't have prebuilt wheels for py3.12 yet
# https://github.com/python-lz4/python-lz4/issues/274
sed -i '/lz4/d' /requirements_common.txt
fi
fi

pip freeze | grep mcdreforged >> /requirements_common.txt
pip3 install -r /requirements_common.txt

Expand Down
21 changes: 9 additions & 12 deletions src/Dockerfile-liberica
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

ARG JAVA
ARG JAVA=17

# https://docs.bell-sw.com/liberica-jdk/latest/general/install-guide/#linux
RUN <<EOT
set -e
export DEBIAN_FRONTEND="noninteractive"
if [ -n "$JAVA" ]; then
apt-get update
apt-get install --no-install-recommends -y gnupg ca-certificates curl
curl -so- https://download.bell-sw.com/pki/GPG-KEY-bellsoft | gpg --dearmor -o /etc/apt/trusted.gpg.d/bellsoft.gpg
echo "deb https://apt.bell-sw.com/ stable main" | tee /etc/apt/sources.list.d/bellsoft.list
apt-get update
apt-get install --no-install-recommends -y "bellsoft-java${JAVA}"
rm -rf /var/lib/apt/lists/*
else
exit 1
fi

apt-get update
apt-get install -y gnupg ca-certificates curl
curl -so- https://download.bell-sw.com/pki/GPG-KEY-bellsoft | gpg --dearmor -o /etc/apt/trusted.gpg.d/bellsoft.gpg
echo "deb https://apt.bell-sw.com/ stable main" | tee /etc/apt/sources.list.d/bellsoft.list
apt-get update
apt-get install -y "bellsoft-java${JAVA}"
rm -rf /var/lib/apt/lists/*
EOT
27 changes: 12 additions & 15 deletions src/Dockerfile-temurin
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

ARG JAVA
ARG JAVA=17

# https://adoptium.net/installation/linux/
RUN <<EOT
set -e
export DEBIAN_FRONTEND="noninteractive"
if [ -n "$JAVA" ]; then
# hopefully this fixes the random connection error issue
# https://github.com/adoptium/installer/issues/766#issuecomment-1856884963
cat <<EOF > /etc/apt/apt.conf.d/timeout_tweak.conf

# hopefully this fixes the random connection error issue
# https://github.com/adoptium/installer/issues/766#issuecomment-1856884963
cat <<EOF > /etc/apt/apt.conf.d/timeout_tweak.conf
Acquire::http::Timeout "30";
Acquire::http::ConnectionAttemptDelayMsec "2000";
Acquire::https::Timeout "30";
Expand All @@ -20,14 +20,11 @@ Acquire::ftp::ConnectionAttemptDelayMsec "2000";
Acquire::Retries "15";
EOF

apt-get update
apt-get install --no-install-recommends -y gnupg ca-certificates curl
curl -so- https://packages.adoptium.net/artifactory/api/gpg/key/public | gpg --dearmor -o /etc/apt/trusted.gpg.d/adoptium.gpg
echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list
apt-get update
apt-get install --no-install-recommends -y "temurin-${JAVA}-jdk"
rm -rf /var/lib/apt/lists/* /etc/apt/apt.conf.d/timeout_tweak.conf
else
exit 1
fi
apt-get update
apt-get install -y gnupg ca-certificates curl
curl -so- https://packages.adoptium.net/artifactory/api/gpg/key/public | gpg --dearmor -o /etc/apt/trusted.gpg.d/adoptium.gpg
echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list
apt-get update
apt-get install -y "temurin-${JAVA}-jdk"
rm -rf /var/lib/apt/lists/* /etc/apt/apt.conf.d/timeout_tweak.conf
EOT
21 changes: 9 additions & 12 deletions src/Dockerfile-zulu
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

ARG JAVA
ARG JAVA=17

# https://docs.azul.com/core/install/debian#install-from-azul-apt-repository
RUN <<EOT
set -e
export DEBIAN_FRONTEND="noninteractive"
if [ -n "$JAVA" ]; then
apt-get update
apt-get install --no-install-recommends -y gnupg ca-certificates curl
curl -so- https://repos.azul.com/azul-repo.key | gpg --dearmor -o /etc/apt/trusted.gpg.d/azul.gpg
echo "deb https://repos.azul.com/zulu/deb stable main" | tee /etc/apt/sources.list.d/zulu.list
apt-get update
apt-get install --no-install-recommends -y "zulu${JAVA}-jdk"
rm -rf /var/lib/apt/lists/*
else
exit 1
fi

apt-get update
apt-get install -y gnupg ca-certificates curl
curl -so- https://repos.azul.com/azul-repo.key | gpg --dearmor -o /etc/apt/trusted.gpg.d/azul.gpg
echo "deb https://repos.azul.com/zulu/deb stable main" | tee /etc/apt/sources.list.d/zulu.list
apt-get update
apt-get install -y "zulu${JAVA}-jdk"
rm -rf /var/lib/apt/lists/*
EOT

0 comments on commit 213fa70

Please sign in to comment.