Merge pull request 'feat: add nfpm/go to buildrunner' (#2) from neoloc/nfpm into master
All checks were successful
Deploy / build (push) Successful in 5m17s

Reviewed-on: https://git.query.consul/unkin/docker-almalinux-buildrunner/pulls/2
This commit is contained in:
Ben Vincent 2024-11-30 23:49:15 +11:00
commit 2d883f6c31
2 changed files with 14 additions and 7 deletions

View File

@ -1,17 +1,18 @@
# Start with the AlmaLinux 8.10 base image
FROM git.query.consul/unkin/almalinux8:latest
# Clean and update the repository cache
RUN dnf clean all && \
dnf makecache
# Install nodejs:20 for actions
RUN dnf module enable -y nodejs:20 && \
dnf install -y nodejs
# Install build-essential
# Install build tools and dependencies for building RPMs
RUN dnf groupinstall -y 'Development Tools' && \
dnf install -y make cmake gcc gcc-c++ rpm rpmdevtools wget
dnf install -y make cmake gcc gcc-c++ rpm rpmdevtools wget tar gzip go
# Install nfpm using the RPM package
ARG NFPM_VERSION
ENV NFPM_VERSION=${NFPM_VERSION}
RUN dnf install -y https://github.com/goreleaser/nfpm/releases/download/v${NFPM_VERSION}/nfpm-${NFPM_VERSION}-1.x86_64.rpm
# Cleanup
RUN dnf clean all && \

View File

@ -1,3 +1,6 @@
# Set the nfpm version to install
NFPM_VERSION := 2.41.1
# Get the current Git commit hash
GIT_COMMIT := $(shell git rev-parse --short HEAD)
@ -11,7 +14,10 @@ OWNER := unkin
# Build the Docker image (without tags)
build:
docker build --network=host -t $(REGISTRY)/$(OWNER)/$(IMAGE_NAME) .
docker build \
--network=host \
--build-arg NFPM_VERSION=$(NFPM_VERSION) \
-t $(REGISTRY)/$(OWNER)/$(IMAGE_NAME) .
# Tag the Docker image with the Git commit hash, the date, and 'latest'
tag: