mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 06:10:44 +08:00
Check arch for podman build
Usually going with Darwin -> aarch64 and the rest fallback to amd64 isn't a bad choice, but I think we can do better by checking `arch` so a device like a Raspberry which has an ARM CPU is able to run the build script.
This commit is contained in:
@@ -10,6 +10,8 @@ main() {
|
||||
export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)
|
||||
# Define user OS for podman
|
||||
export OS=$(uname)
|
||||
# Define architecture for podman
|
||||
export ARCH=$(arch)
|
||||
|
||||
if ! command -v rad >/dev/null; then
|
||||
echo "fatal: rad is not installed" >&2
|
||||
@@ -54,7 +56,7 @@ main() {
|
||||
--build-arg LC_ALL \
|
||||
--build-arg RADICLE_VERSION=$version \
|
||||
--build-arg GIT_HEAD=$rev \
|
||||
--arch aarch64 --tag $image -f ./build/Dockerfile - <$gitarchive
|
||||
--arch $ARCH --tag $image -f ./build/Dockerfile - <$gitarchive
|
||||
|
||||
echo "Creating container (radicle-build-container).."
|
||||
podman create --ulimit=host --replace --name radicle-build-container $image
|
||||
@@ -65,7 +67,7 @@ main() {
|
||||
--build-arg TZ \
|
||||
--build-arg LC_ALL \
|
||||
--build-arg RADICLE_VERSION=$version \
|
||||
--arch amd64 --tag $image -f ./build/Dockerfile - <$gitarchive
|
||||
--arch $ARCH --tag $image -f ./build/Dockerfile - <$gitarchive
|
||||
|
||||
echo "Creating container (radicle-build-container).."
|
||||
podman --cgroup-manager=cgroupfs create --ulimit=host --replace --name radicle-build-container $image
|
||||
|
||||
Reference in New Issue
Block a user