Use Podman for building

Signed-off-by: Erik Bernoth <ebernoth@redhat.com>
This commit is contained in:
Erik Bernoth 2020-08-03 14:25:30 +02:00 committed by Peter Hunt
parent fe1563ca94
commit 5a6b2aca34
2 changed files with 30 additions and 0 deletions

20
Containerfile Normal file
View File

@ -0,0 +1,20 @@
FROM registry.fedoraproject.org/fedora:latest
RUN sudo dnf install -y make automake gcc gcc-c++ kernel-devel glib2-devel && \
sudo dnf clean all && \
rm -rf /var/cache/dnf
RUN sudo dnf update -y && \
sudo dnf clean all && \
rm -rf /var/cache/dnf
# replaces the mktemp from the tutorial as everything is temporary in a
# container unless bind mounted out
RUN mkdir -p /tmp/gocache
ENV GOCACHE=/tmp/gocache
RUN mkdir -p /devenv
ADD . /devenv
WORKDIR /devenv
RUN make

View File

@ -105,3 +105,13 @@ fmt:
find . '(' -name '*.h' -o -name '*.c' ! -path './vendor/*' ')' -exec clang-format -i {} \+
find . -name '*.go' ! -path './vendor/*' -exec gofmt -s -w {} \+
git diff --exit-code
.PHONY: dbuild
dbuild:
-mkdir -p bin
-podman rm conmon-devenv
podman build -t conmon-devenv:latest .
podman create --name conmon-devenv conmon-devenv:latest
podman cp conmon-devenv:/devenv/bin/conmon bin/conmon
@echo "for installation move conmon file to /usr/local/libexec/podman/"