-
-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #452 from williamdes/multi-dist
Build multi OS for Docker
- Loading branch information
Showing
9 changed files
with
274 additions
and
67 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,38 @@ | ||
#!/bin/sh | ||
|
||
set -eu | ||
|
||
if [ "${1:-}" = "alpine" ]; then | ||
BUILD_OS="alpine" | ||
BUILD_BASE="3.20" | ||
elif [ "${1:-}" = "debian" ]; then | ||
BUILD_OS="debian" | ||
BUILD_BASE="bookworm-slim" | ||
else | ||
echo "Usage: docker-build.sh alpine" | ||
echo "Usage: docker-build.sh debian" | ||
exit 1 | ||
fi | ||
|
||
if [ -z "${RELEASE_VERSION:-}" ]; then | ||
RELEASE_VERSION="$(git describe --abbrev=4 --tags HEAD || git describe --abbrev=4 HEAD || git rev-parse HEAD)" | ||
fi | ||
|
||
set -x | ||
|
||
echo "Building for: ${BUILD_OS}" | ||
echo "Release: ${RELEASE_VERSION}" | ||
|
||
# https://github.com/docker/buildx#building | ||
docker buildx build \ | ||
--build-arg VCS_REF="$(git rev-parse HEAD)" \ | ||
--build-arg BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \ | ||
--build-arg BUILD_OS="${BUILD_OS}" \ | ||
--build-arg RELEASE_VERSION="${RELEASE_VERSION}" \ | ||
--build-arg BUILD_BASE="${BUILD_BASE}" \ | ||
--tag ${IMAGE_TAG:-kcov} \ | ||
--progress ${PROGRESS_MODE:-plain} \ | ||
--platform ${PLATFORM:-linux/amd64} \ | ||
--pull \ | ||
--${ACTION:-load} \ | ||
. |
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
Oops, something went wrong.