From cde575bd7e3523ae1c89a3e80aa5f2f49ce98d11 Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Mon, 6 Oct 2025 20:40:25 +0700 Subject: [PATCH] feat: oraclejdk --- .github/workflows/publish-oraclejdk-8.yml | 43 +++++++++++++++++++++++ couchbase-2.5/scripts/entrypoint.sh | 2 +- oraclejdk-8/Dockerfile | 37 +++++++++++++++++++ 3 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish-oraclejdk-8.yml create mode 100644 oraclejdk-8/Dockerfile diff --git a/.github/workflows/publish-oraclejdk-8.yml b/.github/workflows/publish-oraclejdk-8.yml new file mode 100644 index 0000000..8b1d3dc --- /dev/null +++ b/.github/workflows/publish-oraclejdk-8.yml @@ -0,0 +1,43 @@ +name: Publish Oracle JDK 8 Docker Image + +on: + push: + branches: [main] + paths: + - 'oraclejdk-8/**' + workflow_dispatch: + +jobs: + build-and-push: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata + id: meta + uses: docker/metadata-action@v4 + with: + images: ghcr.io/${{ github.repository }}/oraclejdk-8 + tags: | + type=raw,value=latest + type=raw,value=8u201 + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: oraclejdk-8 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/couchbase-2.5/scripts/entrypoint.sh b/couchbase-2.5/scripts/entrypoint.sh index 25e51cb..f1077e7 100644 --- a/couchbase-2.5/scripts/entrypoint.sh +++ b/couchbase-2.5/scripts/entrypoint.sh @@ -55,7 +55,7 @@ overridePort "ssl_proxy_upstream_port" fi echo "Starting Couchbase Server -- Web UI available at http://:$restPortValue" echo "and logs available in /opt/couchbase/var/lib/couchbase/logs" - exec /usr/sbin/runsvdir -P /etc/service + exec /usr/bin/runsvdir -P /etc/service } # fi diff --git a/oraclejdk-8/Dockerfile b/oraclejdk-8/Dockerfile new file mode 100644 index 0000000..6cea040 --- /dev/null +++ b/oraclejdk-8/Dockerfile @@ -0,0 +1,37 @@ +FROM ubuntu:18.04 + +# Set environment variables +ENV JAVA_HOME /opt/jdk1.8.0_201 +ENV PATH $JAVA_HOME/bin:$PATH +ENV JAVA_VERSION 8u201 +ENV JAVA_URL https://repo.huaweicloud.com/java/jdk/8u201-b09/jdk-8u201-linux-x64.tar.gz + +# Install dependencies +RUN apt-get update && \ + apt-get install -y wget curl && \ + rm -rf /var/lib/apt/lists/* + +# Download and install Oracle JDK 8 u201 from Huawei Cloud repository +RUN mkdir -p /tmp/jdk && \ + cd /tmp/jdk && \ + wget -O jdk-8u201-linux-x64.tar.gz $JAVA_URL && \ + mkdir -p /opt && \ + cd /opt && \ + tar -xzf /tmp/jdk/jdk-8u201-linux-x64.tar.gz && \ + rm -rf /tmp/jdk + +# Set up alternatives for java commands +RUN update-alternatives --install /usr/bin/java java $JAVA_HOME/bin/java 100 && \ + update-alternatives --install /usr/bin/javac javac $JAVA_HOME/bin/javac 100 + +# Verify installation +RUN java -version && javac -version + +# Clean up +RUN apt-get clean + +# Set working directory +WORKDIR /app + +# Default command +CMD ["bash"] \ No newline at end of file