Skip to content

Commit

Permalink
docker: Creating docker latest image
Browse files Browse the repository at this point in the history
- Create docker multiarch image with/without push
- Create docker latest image and publish if asked

Changelog-None
  • Loading branch information
ShahanaFarooqui authored and cdecker committed Dec 12, 2023
1 parent a9aa93d commit 7851834
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions tools/build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -210,16 +210,26 @@ if [ -z "${TARGETS##* docker *}" ]; then
)
rm -rf "${TMPDIR}"
done
echo "Creating a multi-platform image tagged as $VERSION"
docker manifest create --amend "$DOCKER_USER"/lightningd:"$VERSION" "$DOCKER_USER"/lightningd:"$VERSION"-amd64 "$DOCKER_USER"/lightningd:"$VERSION"-arm64v8
docker manifest annotate "$DOCKER_USER"/lightningd:"$VERSION" "$DOCKER_USER"/lightningd:"$VERSION"-amd64 --os linux --arch amd64
docker manifest annotate "$DOCKER_USER"/lightningd:"$VERSION" "$DOCKER_USER"/lightningd:"$VERSION"-arm64v8 --os linux --arch arm64 --variant v8
# FIXME: Throws ERROR: failed to solve: debian:bullseye-slim: no match for platform in manifest
# docker buildx create --use
# docker buildx build --push --platform linux/amd64,linux/arm64v8 -t "$DOCKER_USER/lightningd:"$VERSION"-$d" .
echo "Creating a multi-platform image tagged as latest"
# Remove the old image
docker rmi "$DOCKER_USER"/lightningd:latest
# Remove the old manifest
docker manifest rm "$DOCKER_USER"/lightningd:latest
docker manifest create "$DOCKER_USER"/lightningd:latest "$DOCKER_USER"/lightningd:"$VERSION"-amd64 "$DOCKER_USER"/lightningd:"$VERSION"-arm64v8
docker manifest annotate "$DOCKER_USER"/lightningd:latest "$DOCKER_USER"/lightningd:"$VERSION"-amd64 --os linux --arch amd64
docker manifest annotate "$DOCKER_USER"/lightningd:latest "$DOCKER_USER"/lightningd:"$VERSION"-arm64v8 --os linux --arch arm64 --variant v8
if $DOCKER_PUSH; then
echo "Creating and pushing a multi-platform image tagged as $VERSION"
docker manifest create --amend "$DOCKER_USER"/lightningd:"$VERSION" "$DOCKER_USER"/lightningd:"$VERSION"-amd64 "$DOCKER_USER"/lightningd:"$VERSION"-arm64v8
docker manifest annotate "$DOCKER_USER"/lightningd:"$VERSION" "$DOCKER_USER"/lightningd:"$VERSION"-amd64 --os linux --arch amd64
docker manifest annotate "$DOCKER_USER"/lightningd:"$VERSION" "$DOCKER_USER"/lightningd:"$VERSION"-arm64v8 --os linux --arch arm64 --variant v8
docker manifest push "$DOCKER_USER"/lightningd:"$VERSION"
# FIXME: Throws ERROR: failed to solve: debian:bullseye-slim: no match for platform in manifest
# docker buildx create --use
# docker buildx build --push --platform linux/amd64,linux/arm64v8 -t "$DOCKER_USER/lightningd:"$VERSION"-$d" .
echo "Pushed a multi-platform image tagged as $VERSION"
docker manifest push "$DOCKER_USER"/lightningd:latest
echo "Pushed a multi-platform image tagged as latest"
else
echo "Docker Images Built. Ready to Upload on Dockerhub."
fi
Expand Down

0 comments on commit 7851834

Please sign in to comment.