diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..1312c58 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +version: 2 +updates: +- package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + open-pull-requests-limit: 1 +- package-ecosystem: "docker" + directory: "/" + schedule: + interval: "daily" + open-pull-requests-limit: 1 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..2119ae4 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,72 @@ +name: Docker Image + +on: + schedule: + - cron: "0 11 * * *" # everyday at 11am + push: + branches: ["**"] + tags: ["v*.*.*"] + +env: + platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 + +jobs: + main: + runs-on: ubuntu-latest + timeout-minutes: 30 + env: + # Docker Hub credentials are not available for pull requests and Dependabot runs + publish: ${{ github.event_name != 'pull_request' && github.actor != 'dependabot[bot]' }} + steps: + - name: Check out the repo + uses: actions/checkout@v7 + - name: Set imageName based on the repository name + id: step_one + run: | + imageName="${GITHUB_REPOSITORY/docker-/}" + echo $imageName + echo "imageName=$imageName" >> $GITHUB_ENV + - name: Docker meta + id: docker_meta + uses: crazy-max/ghaction-docker-meta@v6 + with: + images: ${{ env.imageName }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v4 + - name: Login to Docker Hub + if: env.publish == 'true' + uses: docker/login-action@v4.6.0 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Buildx cache + uses: actions/cache@v6 + with: + path: ${{ github.workspace }}/cache + key: ${{ runner.os }}-docker-${{ hashfiles('cache/**') }} + restore-keys: | + ${{ runner.os }}-docker + - name: Build and push + id: docker_build + uses: docker/build-push-action@v7 + with: + platforms: ${{ env.publish == 'true' && env.platforms || 'linux/amd64' }} + push: ${{ env.publish == 'true' }} + load: ${{ env.publish != 'true' }} + tags: ${{ steps.docker_meta.outputs.tags }} + labels: ${{ steps.docker_meta.outputs.labels }} + cache-from: type=local,src=${{ github.workspace }}/cache + cache-to: type=local,dest=${{ github.workspace }}/cache + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@v0.36.0 + with: + image-ref: ${{ env.imageName }}:${{ steps.docker_meta.outputs.version }} + format: "template" + template: "@/contrib/sarif.tpl" + output: "trivy-results.sarif" + - name: Upload Trivy scan results to GitHub Security tab + uses: github/codeql-action/upload-sarif@v4.38.0 + with: + sarif_file: "trivy-results.sarif" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c12807d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +# No Node.js dependencies needed \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 83c7d2a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -sudo: required - -services: - - docker - -script: - - docker build -t beevelop/java . - - docker run -d beevelop/java - - docker ps -a - - docker run beevelop/java /bin/sh -c "java -version" diff --git a/Dockerfile b/Dockerfile index 9b4bf94..be6cef7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,11 @@ FROM beevelop/base -MAINTAINER Maik Hummel - - # required to use add-apt-repository -RUN buildDeps='software-properties-common'; \ - set -x && \ - apt-get update && apt-get install -y $buildDeps --no-install-recommends && \ - - # use WebUpd8 PPA - add-apt-repository ppa:webupd8team/java -y && \ - apt-get update -y && \ - - # automatically accept the Oracle license - echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections && \ - apt-get install -y oracle-java8-installer && \ - apt-get install -y oracle-java8-set-default && \ - - # clean up +# Install OpenJDK 17 and clean up in a single layer +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + openjdk-17-jdk-headless && \ + apt-get clean && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ - apt-get purge -y --auto-remove $buildDeps && \ - apt-get autoremove -y && apt-get clean + java -version -ENV JAVA_HOME /usr/lib/jvm/java-8-oracle +ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0d92c73 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2025 Maik Hummel + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 9487cc6..2b8eb3b 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,62 @@ -[![Travis](https://shields.beevelop.com/travis/beevelop/docker-java.svg?style=flat-square)](https://travis-ci.org/beevelop/docker-java) -[![Pulls](https://shields.beevelop.com/docker/pulls/beevelop/java.svg?style=flat-square)](https://links.beevelop.com/d-java) -[![Layers](https://shields.beevelop.com/docker/image/layers/beevelop/java/latest.svg?style=flat-square)](https://links.beevelop.com/d-java) -[![Size](https://shields.beevelop.com/docker/image/size/beevelop/java/latest.svg?style=flat-square)](https://links.beevelop.com/d-java) -[![Release](https://shields.beevelop.com/github/release/beevelop/docker-java.svg?style=flat-square)](https://github.com/beevelop/docker-java/releases) -![Badges](https://shields.beevelop.com/badge/badges-7-brightgreen.svg?style=flat-square) -[![Beevelop](https://links.beevelop.com/honey-badge)](https://beevelop.com) - +![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/beevelop/docker-java/docker.yml?style=for-the-badge) +![Docker Pulls](https://img.shields.io/docker/pulls/beevelop/java.svg?style=for-the-badge) +![Docker Stars](https://img.shields.io/docker/stars/beevelop/java?style=for-the-badge) +![Docker Image Size (tag)](https://img.shields.io/docker/image-size/beevelop/java/latest?style=for-the-badge) +![License](https://img.shields.io/github/license/beevelop/docker-java?style=for-the-badge) +[![GitHub release](https://img.shields.io/github/release/beevelop/docker-java.svg?style=for-the-badge)](https://github.com/beevelop/docker-java/releases) +![GitHub Release Date](https://img.shields.io/github/release-date/beevelop/docker-java?style=for-the-badge) +![CalVer](https://img.shields.io/badge/CalVer-YYYY.MM.MICRO-22bfda.svg?style=for-the-badge) +[![Beevelop](https://img.shields.io/badge/-%20Made%20with%20%F0%9F%8D%AF%20by%20%F0%9F%90%9Dvelop-blue.svg?style=for-the-badge)](https://beevelop.com) ![beevelop/java](/icon.png?raw=true) -# Java 8 (1.8.0_111) -### based on Ubuntu 16.04 (Xenial Xerus) ----- -### Pull from Docker Hub -``` -docker pull beevelop/java:latest -``` -### Build from GitHub -``` +# Docker OpenJDK 17 - Java Development Environment + +> Production-ready OpenJDK 17 Docker image with Maven, Gradle, and Ant for Java application development and CI/CD pipelines. + +## Important Note + +⚠️ **Java Version Change**: Migrated from Java 11 to Java 17 due to Java 11 EOL. Check your toolchain compatibility before upgrading to v2024.* releases. + +## Usage + +### Pull and Run + +```bash +# Pull the latest release +docker pull beevelop/java:v2025.08.3 + +# Run interactively +docker run --rm -it beevelop/java:v2025.08.3 bash + +# Build from source docker build -t beevelop/java github.com/beevelop/docker-java ``` -### Run image -``` -docker run -it beevelop/java bash -``` +### Use as Base Image -### Use as base image ```Dockerfile -FROM beevelop/java:latest +FROM beevelop/java:v2025.08.3 ``` + +--- + +# All Docker Images + +| Badge | Pulls | Build Status | Release Date | Release | +| --- | --- | --- | --- | --- | +| [![base](https://img.shields.io/badge/beevelop%2Fbase-grey?style=flat-square&logo=github)](https://github.com/beevelop/docker-base) | ![Docker Pulls](https://img.shields.io/docker/pulls/beevelop/base.svg?style=flat-square) | ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/beevelop/docker-base/docker.yml?style=flat-square) | ![GitHub Release Date](https://img.shields.io/github/release-date/beevelop/docker-base?style=flat-square) | ![GitHub release](https://img.shields.io/github/release/beevelop/docker-base.svg?style=flat-square) | +| [![java](https://img.shields.io/badge/beevelop%2Fjava-grey?style=flat-square&logo=github)](https://github.com/beevelop/docker-java) | ![Docker Pulls](https://img.shields.io/docker/pulls/beevelop/java.svg?style=flat-square) | ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/beevelop/docker-java/docker.yml?style=flat-square) | ![GitHub Release Date](https://img.shields.io/github/release-date/beevelop/docker-java?style=flat-square) | ![GitHub release](https://img.shields.io/github/release/beevelop/docker-java.svg?style=flat-square) | +| [![android](https://img.shields.io/badge/beevelop%2Fandroid-grey?style=flat-square&logo=github)](https://github.com/beevelop/docker-android) | ![Docker Pulls](https://img.shields.io/docker/pulls/beevelop/android.svg?style=flat-square) | ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/beevelop/docker-android/docker.yml?style=flat-square) | ![GitHub Release Date](https://img.shields.io/github/release-date/beevelop/docker-android?style=flat-square) | ![GitHub release](https://img.shields.io/github/release/beevelop/docker-android.svg?style=flat-square) | +| [![android-nodejs](https://img.shields.io/badge/beevelop%2Fandroid_nodejs-grey?style=flat-square&logo=github)](https://github.com/beevelop/docker-android-nodejs) | ![Docker Pulls](https://img.shields.io/docker/pulls/beevelop/android-nodejs.svg?style=flat-square) | ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/beevelop/docker-android-nodejs/docker.yml?style=flat-square) | ![GitHub Release Date](https://img.shields.io/github/release-date/beevelop/docker-android-nodejs?style=flat-square) | ![GitHub release](https://img.shields.io/github/release/beevelop/docker-android-nodejs.svg?style=flat-square) | +| [![cordova](https://img.shields.io/badge/beevelop%2Fcordova-grey?style=flat-square&logo=github)](https://github.com/beevelop/docker-cordova) | ![Docker Pulls](https://img.shields.io/docker/pulls/beevelop/cordova.svg?style=flat-square) | ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/beevelop/docker-cordova/docker.yml?style=flat-square) | ![GitHub Release Date](https://img.shields.io/github/release-date/beevelop/docker-cordova?style=flat-square) | ![GitHub release](https://img.shields.io/github/release/beevelop/docker-cordova.svg?style=flat-square) | +| [![ionic](https://img.shields.io/badge/beevelop%2Fionic-grey?style=flat-square&logo=github)](https://github.com/beevelop/docker-ionic) | ![Docker Pulls](https://img.shields.io/docker/pulls/beevelop/ionic.svg?style=flat-square) | ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/beevelop/docker-ionic/docker.yml?style=flat-square) | ![GitHub Release Date](https://img.shields.io/github/release-date/beevelop/docker-ionic?style=flat-square) | ![GitHub release](https://img.shields.io/github/release/beevelop/docker-ionic.svg?style=flat-square) | +| [![nginx-basic-auth](https://img.shields.io/badge/beevelop%2Fnginx_basic_auth-grey?style=flat-square&logo=github)](https://github.com/beevelop/docker-nginx-basic-auth) | ![Docker Pulls](https://img.shields.io/docker/pulls/beevelop/nginx-basic-auth.svg?style=flat-square) | ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/beevelop/docker-nginx-basic-auth/docker.yml?style=flat-square) | ![GitHub Release Date](https://img.shields.io/github/release-date/beevelop/docker-nginx-basic-auth?style=flat-square) | ![GitHub release](https://img.shields.io/github/release/beevelop/docker-nginx-basic-auth.svg?style=flat-square) | + +--- + +![Beevelop's Docker Image Hierarchy](https://gist.githubusercontent.com/beevelop/b0cddab7209a683c77560d06ff00bc8e/raw/15429ee1d02e2c4dc019b760ca8c7ceff5911b82/hierarchy.png) + +### Use tags where possible, because + +![One does not simply use latest](https://i.imgflip.com/1fgwxr.jpg)