-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Vivek Yadav
committed
Apr 2, 2024
1 parent
4bf6ee4
commit 67f3de3
Showing
11 changed files
with
187 additions
and
88 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
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,54 @@ | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
image: | ||
description: 'Image to Release' | ||
required: true | ||
type: string | ||
inputs: | ||
tag: | ||
description: 'Tag' | ||
required: true | ||
type: string | ||
|
||
permissions: | ||
id-token: write # This is required for GH OIDC connection | ||
contents: read # This is required for actions/checkout | ||
|
||
jobs: | ||
image-release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Build image | ||
run: | | ||
docker build -t images/SecurePacks/InitzBuilder/Stack/${{ inputs.image }}:${{ inputs.tag }} -f images/SecurePacks/InitzBuilder/Stack/${{ inputs.image }}/Dockerfile . | ||
docker tag images/SecurePacks/InitzBuilder/Stack/${{ inputs.image }}:${{ inputs.tag }} securepacks/${{ inputs.image }}:${{ inputs.tag }} | ||
- name: Tag and push Docker image to Docker Hub | ||
env: | ||
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | ||
REPOSITORY: ${{ inputs.image }} | ||
run: | | ||
docker push securepacks/${{ inputs.image }}:${{ inputs.tag }} | ||
- uses: sigstore/cosign-installer@11086d25041f77fe8fe7b9ea4e48e3b9192b8f19 # v3.1.2 | ||
- name: Sign the images | ||
run: | | ||
cosign sign \ | ||
--yes public.ecr.aws/t4s8c0c3/${{ inputs.image }}:latest | ||
- name: Verify the pushed tags | ||
run: | | ||
cosign verify \ | ||
public.ecr.aws/t4s8c0c3/${{ inputs.image }}:latest \ | ||
--certificate-identity https://github.com/initializ/secure-images/.github/workflows/InitzBuilderdockerfile.yaml@refs/heads/main \ | ||
--certificate-oidc-issuer https://token.actions.githubusercontent.com | jq |
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,66 @@ | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
image: | ||
description: 'Image to Release' | ||
required: true | ||
type: string | ||
|
||
permissions: | ||
id-token: write # This is required for GH OIDC connection | ||
contents: read # This is required for actions/checkout | ||
|
||
jobs: | ||
image-release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Create & Push Minimal Image using apko | ||
id: apko | ||
uses: distroless/actions/apko-build@main | ||
with: | ||
config: images/SecurePacks/PythonBuilder/${{ inputs.image }}/apko.yaml | ||
tag: Python/${{ inputs.image }}:latest | ||
|
||
- name: Tag, and push docker image to Amazon ECR Public | ||
run: | | ||
docker load < output.tar | ||
- name: Check if Docker image exists locally | ||
run: | | ||
if docker images Python/${{ inputs.image }}:latest-amd64 | grep -q Python/${{ inputs.image }}; then | ||
echo "Docker image Python/${{ inputs.image }}:latest found." | ||
else | ||
echo "Docker image Python/${{ inputs.image }}:latest not found. Please build the image first." | ||
exit 1 | ||
fi | ||
- name: Tag and push Docker image to Docker Hub | ||
env: | ||
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | ||
REPOSITORY: ${{ inputs.image }} | ||
run: | | ||
docker tag Python/${{ inputs.image }}:latest-amd64 Python/${{ inputs.image }}:latest | ||
docker push Python/${{ inputs.image }}:latest | ||
- uses: sigstore/cosign-installer@11086d25041f77fe8fe7b9ea4e48e3b9192b8f19 # v3.1.2 | ||
- name: Sign the images | ||
run: | | ||
cosign sign \ | ||
--yes Python/${{ inputs.image }}:latest | ||
- name: Verify the pushed tags | ||
run: | | ||
cosign verify \ | ||
initz/${{ inputs.image }}:latest \ | ||
--certificate-identity https://github.com/initializ/secure-images/.github/workflows/PythonBuilderapkorelease.yml@refs/heads/main \ | ||
--certificate-oidc-issuer https://token.actions.githubusercontent.com | jq | ||
- name: Attest SBOM | ||
run: | | ||
cosign attest \ | ||
--yes --predicate sbom-x86_64.spdx.json --type spdxjson Python/${{ inputs.image }}:latest |
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,54 @@ | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
image: | ||
description: 'Image to Release' | ||
required: true | ||
type: string | ||
inputs: | ||
tag: | ||
description: 'Tag' | ||
required: true | ||
type: string | ||
|
||
permissions: | ||
id-token: write # This is required for GH OIDC connection | ||
contents: read # This is required for actions/checkout | ||
|
||
jobs: | ||
image-release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Build image | ||
run: | | ||
docker build -t images/SecurePacks/PythonBuilder/Stack/${{ inputs.image }}:${{ inputs.tag }} -f images/SecurePacks/PythonBuilder/Stack/${{ inputs.image }}/Dockerfile . | ||
docker tag images/SecurePacks/PythonBuilder/Stack/${{ inputs.image }}:${{ inputs.tag }} pythonsecurepacks/${{ inputs.image }}:${{ inputs.tag }} | ||
- name: Tag and push Docker image to Docker Hub | ||
env: | ||
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | ||
REPOSITORY: ${{ inputs.image }} | ||
run: | | ||
docker push pythonsecurepacks/${{ inputs.image }}:${{ inputs.tag }} | ||
- uses: sigstore/cosign-installer@11086d25041f77fe8fe7b9ea4e48e3b9192b8f19 # v3.1.2 | ||
- name: Sign the images | ||
run: | | ||
cosign sign \ | ||
--yes public.ecr.aws/t4s8c0c3/${{ inputs.image }}:latest | ||
- name: Verify the pushed tags | ||
run: | | ||
cosign verify \ | ||
public.ecr.aws/t4s8c0c3/${{ inputs.image }}:latest \ | ||
--certificate-identity https://github.com/initializ/secure-images/.github/workflows/PythonBuilderdockerfile.yaml@refs/heads/main \ | ||
--certificate-oidc-issuer https://token.actions.githubusercontent.com | jq |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.