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

Add signing #297

Merged
merged 3 commits into from
Jan 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
mkdir -p ~/.docker/cli-plugins
mv docker-buildx ~/.docker/cli-plugins/
chmod +x ~/.docker/cli-plugins/docker-buildx
- uses: sigstore/cosign-installer@main
- name: Build and push multi-arch image
run: |
./docker/multi-arch.sh
Expand Down
16 changes: 12 additions & 4 deletions docker/multi-arch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,22 @@ then
PUSH="--push"
fi

echo $PUSH $DH_IMAGE $GH_IMAGE $DH_REPO $GH_REPO
docker buildx build \
--build-arg VCS_REF="${SOURCE_COMMIT:-$(git rev-parse HEAD)}" \
--build-arg VCS_BRANCH="${SOURCE_BRANCH:-$(git symbolic-ref --short HEAD)}" \
--build-arg REPO="$DH_REPO" \
--build-arg TAG="$TAG" \
--build-arg DATE="$DATE" \
--build-arg VERSION="$VERSION" \
"$PUSH" --pull --platform linux/arm/v7,linux/arm64,linux/amd64 \
-t "$DH_IMAGE" -t "$GH_IMAGE" -t "$DH_REPO":default -t "$GH_REPO":default \
-t containersol/trow:latest -t "$GH_REPO":latest \
-f "Dockerfile" ../
$PUSH --pull --platform linux/arm/v7,linux/arm64,linux/amd64 \
-t $DH_IMAGE -t $GH_IMAGE -t $DH_REPO:default -t $GH_REPO:default \
-t $DH_REPO:latest -t $GH_REPO:latest \
-f Dockerfile ../

# Sign the images
# Assumes runner has installed cosing e.g. uses: sigstore/cosign-installer@main
if [[ "$CI" = true ]]
then
cosign sign $DH_IMAGE $GH_IMAGE $DH_REPO:default $GH_REPO:default $DH_REPO:latest -t $GH_REPO:latest
fi