Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test #314

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open

test #314

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
b499b8f
Create build-scan-and-push.yaml
Limber-Rodriguez-Rojas Nov 17, 2023
fbd0c47
Delete .github/workflows/call-docker-build-result.yaml
Limber-Rodriguez-Rojas Nov 17, 2023
694c874
Delete .github/workflows/call-docker-build-vote.yaml
Limber-Rodriguez-Rojas Nov 17, 2023
fec41cb
Create Dockerfile
Limber-Rodriguez-Rojas Nov 17, 2023
a4f90cc
Update build-scan-and-push.yaml
Limber-Rodriguez-Rojas Nov 17, 2023
36c80f8
Update build-scan-and-push.yaml
Limber-Rodriguez-Rojas Nov 17, 2023
abe0e12
Update build-scan-and-push.yaml
Limber-Rodriguez-Rojas Nov 17, 2023
2dd9582
Update build-scan-and-push.yaml
Limber-Rodriguez-Rojas Nov 17, 2023
b20eeb2
Update build-scan-and-push.yaml
Limber-Rodriguez-Rojas Nov 17, 2023
171887f
Update build-scan-and-push.yaml
Limber-Rodriguez-Rojas Nov 17, 2023
78a7489
Create Dockerfile
Limber-Rodriguez-Rojas Nov 17, 2023
8719ce6
Update build-scan-and-push.yaml
Limber-Rodriguez-Rojas Nov 17, 2023
117b975
Update build-scan-and-push.yaml
Limber-Rodriguez-Rojas Nov 17, 2023
2f3c49f
Update build-scan-and-push.yaml
Limber-Rodriguez-Rojas Nov 17, 2023
af442cf
Update Dockerfile
Limber-Rodriguez-Rojas Nov 18, 2023
b3c0b93
Merge pull request #1 from Limber-Rodriguez-Rojas/Limber-Rodriguez-Ro…
Limber-Rodriguez-Rojas Nov 18, 2023
df7341c
Update Dockerfile
Limber-Rodriguez-Rojas Nov 18, 2023
0b50f29
Merge pull request #2 from Limber-Rodriguez-Rojas/Limber-Rodriguez-Ro…
Limber-Rodriguez-Rojas Nov 21, 2023
7ac44ba
Update Dockerfile
Limber-Rodriguez-Rojas Nov 21, 2023
3394ec7
Update Dockerfile
Limber-Rodriguez-Rojas Nov 21, 2023
873aca5
Merge pull request #4 from Limber-Rodriguez-Rojas/Limber-Rodriguez-Ro…
Limber-Rodriguez-Rojas Nov 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/build-scan-and-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
env:
SYSDIG_SECURE_ENDPOINT: "https://us2.app.sysdig.com"
REGISTRY_HOST: "quay.io"
IMAGE_NAME: "mytestimage"
IMAGE_TAG: "my-tag"
DOCKERFILE_CONTEXT: "k8s-specifications/"
name: Container build, scan and push
on: [push, pull_request]

jobs:
build-scan-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and save
uses: docker/build-push-action@v3
with:
context: ${{ env.DOCKERFILE_CONTEXT }}
tags: ${{ env.REGISTRY_HOST }}/${{ secrets.REGISTRY_USER }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
load: true
- name: Setup cache
uses: actions/cache@v3
with:
path: cache
key: ${{ runner.os }}-cache-${{ hashFiles('**/sysdig-cli-scanner', '**/latest_version.txt', '**/db/main.db.meta.json', '**/scanner-cache/inlineScannerCache.db') }}
restore-keys: ${{ runner.os }}-cache-
- name: Download sysdig-cli-scanner if needed
run: |
curl -sLO https://download.sysdig.com/scanning/sysdig-cli-scanner/latest_version.txt
mkdir -p ${GITHUB_WORKSPACE}/cache/db/
if [ ! -f ${GITHUB_WORKSPACE}/cache/latest_version.txt ] || [ $(cat ./latest_version.txt) != $(cat ${GITHUB_WORKSPACE}/cache/latest_version.txt) ]; then
cp ./latest_version.txt ${GITHUB_WORKSPACE}/cache/latest_version.txt
curl -sL -o ${GITHUB_WORKSPACE}/cache/sysdig-cli-scanner "https://download.sysdig.com/scanning/bin/sysdig-cli-scanner/$(cat ${GITHUB_WORKSPACE}/cache/latest_version.txt)/linux/amd64/sysdig-cli-scanner"
chmod +x ${GITHUB_WORKSPACE}/cache/sysdig-cli-scanner
else
echo "sysdig-cli-scanner latest version already downloaded"
fi
- name: Scan the image using sysdig-cli-scanner
env:
SECURE_API_TOKEN: ${{ secrets.SECURE_API_TOKEN }}
run: |
${GITHUB_WORKSPACE}/cache/sysdig-cli-scanner \
--apiurl ${SYSDIG_SECURE_ENDPOINT} \
docker://${REGISTRY_HOST}/${{ secrets.REGISTRY_USER }}/${IMAGE_NAME}:${IMAGE_TAG} \
--console-log \
--dbpath=${GITHUB_WORKSPACE}/cache/db/ \
--cachepath=${GITHUB_WORKSPACE}/cache/scanner-cache/
- name: Login to the registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY_HOST }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Push
uses: docker/build-push-action@v3
with:
context: ${{ env.DOCKERFILE_CONTEXT }}
push: true
tags: ${{ env.REGISTRY_HOST }}/${{ secrets.REGISTRY_USER }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
82 changes: 0 additions & 82 deletions .github/workflows/call-docker-build-result.yaml

This file was deleted.

82 changes: 0 additions & 82 deletions .github/workflows/call-docker-build-vote.yaml

This file was deleted.

1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM alpine
3 changes: 3 additions & 0 deletions k8s-specifications/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM alpine

RUN apk update && apk add --upgrade openssl