mirror of
https://github.com/tiennm99/docker-images.git
synced 2026-10-13 16:14:50 +00:00
feat: oraclejdk
This commit is contained in:
1 parent
ff6b37e2c8
commit
cde575bd7e
3 files changed
+81
-1
No files matched your search
@@ -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 }}
|
||||
@@ -55,7 +55,7 @@ overridePort "ssl_proxy_upstream_port"
|
||||
fi
|
||||
echo "Starting Couchbase Server -- Web UI available at http://<ip>:$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
|
||||
|
||||
|
||||
@@ -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"]
|
||||
Reference in new issue
Block a user