diff --git a/.github/actions/build-image/action.yml b/.github/actions/build-image/action.yml new file mode 100644 index 0000000..0022528 --- /dev/null +++ b/.github/actions/build-image/action.yml @@ -0,0 +1,27 @@ +name: 'Build And Publish Image' +description: 'Builds and publishes image' +inputs: + version: + description: 'image tag' + required: true + dockerhub-username: + description: 'dockerhub username' + required: true + dockerhub-password: + description: 'dockerhub password' + required: true +runs: + using: "composite" + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + with: + driver-opts: network=host + - name: Build and Push image + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: springcloud/baseimage:${{ inputs.version }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2eb10c0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,24 @@ +name: CI + +on: + workflow_dispatch: + push: + paths-ignore: + - '.github/**' + +jobs: + build: + if: github.repository_owner == 'spring-cloud' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Determine version + run: | + echo baseimage_version=$(cat version.txt) >> $GITHUB_ENV + - name: Build and Publish Images + uses: ./.github/actions/build-images + with: + version: ${{ env.baseimage_version }} + dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }} + dockerhub-password: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/Dockerfile b/Dockerfile index b61ba8c..a7e0420 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -ARG DOWNLOAD_URI=https://github.com/bell-sw/Liberica/releases/download/11.0.8+10/bellsoft-jre11.0.8+10-linux-amd64.tar.gz -ARG SHA256=b4cb31162ff6d7926dd09e21551fa745fa3ae1758c25148b48dadcf78ab0c24c +ARG DOWNLOAD_URI=https://github.com/bell-sw/Liberica/releases/download/11.0.15+10/bellsoft-jre11.0.15+10-linux-amd64.tar.gz +ARG SHA1=a0cae6e964f67497840344c64614f13e530c43c8 # Download and verify file # Args: $DOWNLOAD_URI, $SHA256 @@ -15,8 +15,8 @@ RUN curl -L \ $DOWNLOAD_URI \ > download.tar.gz -ARG SHA256 -RUN echo "${SHA256} download.tar.gz" | sha256sum -c - 2>&1 +ARG SHA1 +RUN echo "${SHA1} download.tar.gz" | sha1sum -c - 2>&1 # Install File FROM ubuntu:bionic @@ -31,7 +31,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y wget COPY --from=retrieve download.tar.gz /tmp/download.tar.gz -LABEL jdk-version=11.0.8_10 +LABEL jdk.version=11.0.15-10 RUN mkdir -p /usr/lib/jvm \ && tar xzf /tmp/download.tar.gz -C /usr/lib/jvm \ diff --git a/README.md b/README.md index bee2592..2f828fb 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,8 @@ You can check the Java version bundled with a particular image tag, like this: docker run -it --rm springcloud/baseimage: java -version ``` -or by retrieving the `jdk-version` image label: +or by retrieving the `jdk.version` image label: ``` -docker inspect springcloud/baseimage: | grep jdk-version +docker inspect springcloud/baseimage: | grep jdk.version ``` diff --git a/version.txt b/version.txt new file mode 100644 index 0000000..7f20734 --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +1.0.1 \ No newline at end of file