Skip to content

Commit

Permalink
added name I think
Browse files Browse the repository at this point in the history
  • Loading branch information
gerblesh committed Jul 23, 2023
1 parent 7f27bf9 commit 7705c5a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ARG IMAGE_REGISTRY=ghcr.io/ublue-os
COPY usr /usr

# Copy public key
COPY cosign.pub /usr/etc/pki/containers/cosign.pub
COPY cosign.pub /usr/share/ublue-os/cosign.pub

# Copy the recipe that we're building.
COPY ${RECIPE} /usr/share/ublue-os/recipe.yml
Expand Down
10 changes: 7 additions & 3 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,17 @@ fi
echo "Setup container signing in policy.json and cosign.yaml"
echo "Registry to write: $IMAGE_REGISTRY"

# Copy Name
NAME=$(get_yaml_string 'name')
cp /usr/share/ublue-os/cosign.pub /usr/etc/pki/containers/"$NAME".pub

# Work around the fact that jq doesn't have an "inplace" option
FILE=/usr/etc/containers/policy.json
TMP=/tmp/policy.json

jq '.transports.docker."$IMAGE_REGISTRY" += [{
"type": "sigstoreSigned",
"keyPath": "/usr/etc/pki/containers/cosign.pub",
"keyPath": "/usr/etc/pki/containers/$NAME.pub",
"signedIdentity": {
"type": "matchRepository"
}
Expand All @@ -125,8 +129,8 @@ mv -f $TMP $FILE

cat $FILE

cp /usr/etc/containers/registries.d/ublue-os.yaml /usr/etc/containers/registries.d/cosign.yaml
sed -i "s ghcr.io/ublue-os $IMAGE_REGISTRY g" /usr/etc/containers/registries.d/cosign.yaml
cp /usr/etc/containers/registries.d/ublue-os.yaml /usr/etc/containers/registries.d/"$NAME".yaml
sed -i "s ghcr.io/ublue-os $IMAGE_REGISTRY g" /usr/etc/containers/registries.d/"$NAME.yaml
# Run "post" scripts.
run_scripts "post"

0 comments on commit 7705c5a

Please sign in to comment.