Skip to content

Commit

Permalink
Use docker bake (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
jplock authored Dec 20, 2024
1 parent d1c49bf commit 415d459
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 21 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/docker-bake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ on:
push:
branches:
- main
- jp-bake
pull_request:
branches:
- main
- jp-bake

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
Expand Down
15 changes: 6 additions & 9 deletions buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,14 @@ phases:
build:
commands:
- echo Build started on `date`
- cd parent
- make build-docker
- CONTAINER_ID=$(docker create parent-vault:latest)
- docker cp $CONTAINER_ID:/app/parent-vault ./parent-vault
- docker rm $CONTAINER_ID
- cd ../enclave
- make build-docker
- docker buildx bake
- echo Build completed on `date`
post_build:
commands:
- '[ ${CODEBUILD_BUILD_SUCCEEDING:-0} -eq 1 ] || exit 1'
- CONTAINER_ID=$(docker create parent-vault:latest)
- docker cp $CONTAINER_ID:/app/parent-vault ./parent-vault
- docker rm $CONTAINER_ID
- echo "${PRIVATE_KEY}" > nitro_vault_key.pem
- openssl req -new -key nitro_vault_key.pem -sha384 -nodes -subj "/CN=AWS/C=US/ST=WA/L=Seattle/O=Amazon/OU=AWS" -out nitro_vault_csr.pem
- openssl x509 -req -days 365 -in nitro_vault_csr.pem -out nitro_vault_cert.pem -sha384 -signkey nitro_vault_key.pem
Expand All @@ -29,8 +26,8 @@ phases:
artifacts:
discard-paths: yes
files:
- parent/parent-vault # Used by Deploy:DeployVault
- enclave/enclave-vault.eif # Used by Deploy:DeployVault
- parent-vault # Used by Deploy:DeployVault
- enclave-vault.eif # Used by Deploy:DeployVault
- vault_template.yml # Used by Deploy:DeployVault
- vault_template_configuration.json # Used by Deploy:DeployVault

Expand Down
10 changes: 0 additions & 10 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,8 @@ target "parent" {
args = {
TARGETPLATFORM = "x86_64-unknown-linux-gnu"
}
attest = [
"type=provenance,mode=max",
"type=sbom",
]
platforms = ["linux/amd64"]
tags = ["parent-vault:latest"]
output = ["type=cacheonly"]
cache-to = ["type=gha,ignore-error=true,mode=max,scope=parent"]
cache-from = ["type=gha,scope=parent"]
}
Expand All @@ -25,13 +20,8 @@ target "enclave" {
args = {
TARGETPLATFORM = "x86_64-unknown-linux-musl"
}
attest = [
"type=provenance,mode=max",
"type=sbom",
]
platforms = ["linux/amd64"]
tags = ["enclave-vault:latest"]
output = ["type=cacheonly"]
cache-to = ["type=gha,ignore-error=true,mode=max,scope=enclave"]
cache-from = ["type=gha,scope=enclave"]
}

0 comments on commit 415d459

Please sign in to comment.