Merge pull request #4 from pothos/building-with-podman

Support building with Podman instead of Docker
This commit is contained in:
Gabriel 2022-06-30 14:09:01 +03:00 committed by GitHub
commit 7da2875e2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View file

@ -1,4 +1,4 @@
FROM golang:alpine
FROM docker.io/golang:alpine
WORKDIR /root
USER root
@ -8,4 +8,4 @@ RUN apk add musl-dev gcc libtool m4 autoconf g++ make libblkid util-linux-dev gi
ADD ./scripts/build-static.sh /build-static.sh
RUN chmod +x /build-static.sh
CMD ["/bin/sh"]
CMD ["/bin/sh"]

View file

@ -4,8 +4,11 @@ SHELL := bash
IMAGE_TAG = garm-build
USER_ID=$(shell (docker --version | grep -q podman) && echo "0" || shell id -u)
USER_GROUP=$(shell (docker --version | grep -q podman) && echo "0" || shell id -g)
build-static:
@echo Building garm
docker build --tag $(IMAGE_TAG) .
docker run --rm -e USER_ID="$(shell id -u)" -e USER_GROUP="$(shell id -g)" -v $(PWD):/build/garm $(IMAGE_TAG) /build-static.sh
docker run --rm -e USER_ID=$(USER_ID) -e USER_GROUP=$(USER_GROUP) -v $(PWD):/build/garm $(IMAGE_TAG) /build-static.sh
@echo Binaries are available in $(PWD)/bin