Skip to content

Commit 2beaa76

Browse files
author
Maik Hummel
committed
Update image
1 parent e4675fe commit 2beaa76

3 files changed

Lines changed: 87 additions & 29 deletions

File tree

.github/workflows/docker.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Docker Image
2+
3+
on:
4+
schedule:
5+
- cron: "0 10 * * *" # everyday at 10am
6+
push:
7+
branches: ["**"]
8+
tags: ["v*.*.*"]
9+
10+
env:
11+
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/s390x,linux/ppc64le
12+
13+
jobs:
14+
main:
15+
runs-on: ubuntu-20.04
16+
timeout-minutes: 5
17+
steps:
18+
- name: Check out the repo
19+
uses: actions/checkout@v2
20+
- name: Set imageName based on the repository name
21+
id: step_one
22+
run: |
23+
imageName="${GITHUB_REPOSITORY/docker-/}"
24+
echo $imageName
25+
echo "imageName=$imageName" >> $GITHUB_ENV
26+
- name: Docker meta
27+
id: docker_meta
28+
uses: crazy-max/ghaction-docker-meta@v1
29+
with:
30+
images: ${{ env.imageName }}
31+
- name: Set up QEMU
32+
uses: docker/setup-qemu-action@v1
33+
- name: Set up Docker Buildx
34+
uses: docker/setup-buildx-action@v1
35+
- name: Login to Harbor
36+
uses: docker/login-action@v1
37+
with:
38+
username: ${{ secrets.DOCKERHUB_USERNAME }}
39+
password: ${{ secrets.DOCKERHUB_TOKEN }}
40+
- name: Buildx cache
41+
uses: actions/cache@v1
42+
with:
43+
path: ${{ github.workspace }}/cache
44+
key: ${{ runner.os }}-docker-${{ hashfiles('cache/**') }}
45+
restore-keys: |
46+
${{ runner.os }}-docker
47+
- name: Build and push
48+
id: docker_build
49+
uses: docker/build-push-action@v2
50+
with:
51+
platforms: ${{ env.platforms }}
52+
push: ${{ github.event_name != 'pull_request' }}
53+
tags: ${{ steps.docker_meta.outputs.tags }}
54+
labels: ${{ steps.docker_meta.outputs.labels }}
55+
cache-from: type=local,src=${{ github.workspace }}/cache
56+
cache-to: type=local,dest=${{ github.workspace }}/cache
57+
- name: Run Trivy vulnerability scanner
58+
uses: aquasecurity/trivy-action@master
59+
with:
60+
image-ref: ${{ env.imageName }}:${{ steps.docker_meta.outputs.version }}
61+
format: "template"
62+
template: "@/contrib/sarif.tpl"
63+
output: "trivy-results.sarif"
64+
- name: Upload Trivy scan results to GitHub Security tab
65+
uses: github/codeql-action/upload-sarif@v1
66+
with:
67+
sarif_file: "trivy-results.sarif"

.travis.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

Dockerfile

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@ ARG BUILD_VERSION
55
ARG VCS_REF
66

77
LABEL maintainer="Maik Hummel <[email protected]>" \
8-
org.label-schema.build-date=$BUILD_DATE \
9-
org.label-schema.version=$BUILD_VERSION \
10-
org.label-schema.vcs-ref=$VCS_REF \
11-
org.label-schema.schema-version="1.0" \
12-
org.label-schema.vcs-url="https://github.com/beevelop/docker-java.git" \
13-
org.label-schema.name="beevelop/java" \
14-
org.label-schema.vendor="Maik Hummel (beevelop)" \
15-
org.label-schema.description="Simple Java Docker image (used as base image)" \
16-
org.label-schema.url="https://beevelop.com/" \
17-
org.label-schema.license="MIT" \
18-
org.opencontainers.image.title="beevelop/java" \
19-
org.opencontainers.image.description="Simple Java Docker image (used as base image)" \
20-
org.opencontainers.image.licenses="MIT" \
21-
org.opencontainers.image.authors="Maik Hummel (beevelop)" \
22-
org.opencontainers.image.vendor="Maik Hummel (beevelop)" \
23-
org.opencontainers.image.url="https://github.com/beevelop/docker-java" \
24-
org.opencontainers.image.documentation="https://github.com/beevelop/docker-java/blob/master/README.md" \
25-
org.opencontainers.image.source="https://github.com/beevelop/docker-java.git"
8+
org.label-schema.build-date=$BUILD_DATE \
9+
org.label-schema.version=$BUILD_VERSION \
10+
org.label-schema.vcs-ref=$VCS_REF \
11+
org.label-schema.schema-version="1.0" \
12+
org.label-schema.vcs-url="https://github.com/beevelop/docker-java.git" \
13+
org.label-schema.name="beevelop/java" \
14+
org.label-schema.vendor="Maik Hummel (beevelop)" \
15+
org.label-schema.description="Simple Java Docker image (used as base image)" \
16+
org.label-schema.url="https://beevelop.com/" \
17+
org.label-schema.license="MIT" \
18+
org.opencontainers.image.title="beevelop/java" \
19+
org.opencontainers.image.description="Simple Java Docker image (used as base image)" \
20+
org.opencontainers.image.licenses="MIT" \
21+
org.opencontainers.image.authors="Maik Hummel (beevelop)" \
22+
org.opencontainers.image.vendor="Maik Hummel (beevelop)" \
23+
org.opencontainers.image.url="https://github.com/beevelop/docker-java" \
24+
org.opencontainers.image.documentation="https://github.com/beevelop/docker-java/blob/master/README.md" \
25+
org.opencontainers.image.source="https://github.com/beevelop/docker-java.git"
2626

2727
# required to use add-apt-repository
2828
RUN buildDeps='software-properties-common'; \
@@ -34,6 +34,7 @@ RUN buildDeps='software-properties-common'; \
3434
java -version && \
3535
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
3636
apt-get purge -y --auto-remove $buildDeps && \
37-
apt-get autoremove -y && apt-get clean
37+
apt-get autoremove -y && apt-get clean && \
38+
java -version
3839

3940
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64

0 commit comments

Comments
 (0)