-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from beevelop/update
Update image
- Loading branch information
Showing
5 changed files
with
82 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Docker Image | ||
|
||
on: | ||
schedule: | ||
- cron: "0 10 * * *" # everyday at 10am | ||
push: | ||
branches: ["**"] | ||
tags: ["v*.*.*"] | ||
|
||
env: | ||
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6 | ||
|
||
jobs: | ||
main: | ||
runs-on: ubuntu-20.04 | ||
timeout-minutes: 20 | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v2 | ||
- 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@v1 | ||
with: | ||
images: ${{ env.imageName }} | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Login to Harbor | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Buildx cache | ||
uses: actions/cache@v1 | ||
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@v2 | ||
with: | ||
platforms: ${{ env.platforms }} | ||
push: ${{ github.event_name != 'pull_request' }} | ||
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@master | ||
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@v1 | ||
with: | ||
sarif_file: "trivy-results.sarif" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,5 @@ | ||
FROM nginx:alpine | ||
|
||
ARG BUILD_DATE | ||
ARG BUILD_VERSION | ||
ARG VCS_REF | ||
|
||
LABEL maintainer="Maik Hummel <[email protected]>" \ | ||
org.label-schema.build-date=$BUILD_DATE \ | ||
org.label-schema.version=$BUILD_VERSION \ | ||
org.label-schema.vcs-ref=$VCS_REF \ | ||
org.label-schema.schema-version="1.0" \ | ||
org.label-schema.vcs-url="https://github.com/beevelop/docker-nginx-basic-auth.git" \ | ||
org.label-schema.name="beevelop/nginx-basic-auth" \ | ||
org.label-schema.vendor="Maik Hummel (beevelop)" \ | ||
org.label-schema.description="Simple Docker image for basic authentication" \ | ||
org.label-schema.url="https://beevelop.com/" \ | ||
org.label-schema.license="MIT" \ | ||
org.opencontainers.image.title="beevelop/nginx-basic-auth" \ | ||
org.opencontainers.image.description="Simple Docker image for basic authentication" \ | ||
org.opencontainers.image.licenses="MIT" \ | ||
org.opencontainers.image.authors="Maik Hummel (beevelop)" \ | ||
org.opencontainers.image.vendor="Maik Hummel (beevelop)" \ | ||
org.opencontainers.image.url="https://github.com/beevelop/docker-nginx-basic-auth" \ | ||
org.opencontainers.image.documentation="https://github.com/beevelop/docker-nginx-basic-auth/blob/master/README.md" \ | ||
org.opencontainers.image.source="https://github.com/beevelop/docker-nginx-basic-auth.git" | ||
|
||
ENV HTPASSWD='foo:$apr1$odHl5EJN$KbxMfo86Qdve2FH4owePn.' \ | ||
FORWARD_PORT=80 \ | ||
FORWARD_HOST=web | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters