Compare commits
14 Commits
b6ecb8d682
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| ad79c5e0eb | |||
| b33491571b | |||
| 5f4a01a781 | |||
| 3bfd67987c | |||
| d92a0ccceb | |||
| 0303429dbf | |||
| 146b4d2808 | |||
| 3a0e93e18f | |||
| 839b39f78e | |||
| 7917c198a7 | |||
| 2d883f6c31 | |||
| 760b67b9e8 | |||
| e0fee84e65 | |||
| b744adde0c |
@@ -0,0 +1,19 @@
|
|||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: almalinux-8
|
||||||
|
container:
|
||||||
|
image: git.query.consul/unkin/almalinux8-runnerdnd:latest
|
||||||
|
options: --privileged
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Build Docker Image
|
||||||
|
run: |
|
||||||
|
make build
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
name: Deploy
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: almalinux-8
|
||||||
|
container:
|
||||||
|
image: git.query.consul/unkin/almalinux8-runnerdnd:latest
|
||||||
|
options: --privileged
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Build Docker Image
|
||||||
|
run: |
|
||||||
|
make build
|
||||||
|
|
||||||
|
- name: Log in to Docker
|
||||||
|
env:
|
||||||
|
UPLOAD_USER: ${{ secrets.UPLOAD_USER }}
|
||||||
|
UPLOAD_PASS: ${{ secrets.UPLOAD_PASS }}
|
||||||
|
run: |
|
||||||
|
echo "$UPLOAD_PASS" | docker login --username=$UPLOAD_USER --password-stdin git.query.consul
|
||||||
|
|
||||||
|
- name: Push Docker Image
|
||||||
|
run: |
|
||||||
|
make push
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
# Variables
|
||||||
|
GIT_COMMIT := $(shell git rev-parse --short HEAD)
|
||||||
|
DATE_TAG := $(shell date +%Y%m%d)
|
||||||
|
REGISTRY := git.query.consul
|
||||||
|
OWNER := unkin
|
||||||
|
|
||||||
|
# List of releases (directories under ./release)
|
||||||
|
RELEASES := $(shell find release -mindepth 1 -maxdepth 1 -type d -exec basename {} \;)
|
||||||
|
|
||||||
|
# Build all releases
|
||||||
|
build: $(addprefix build-,$(RELEASES))
|
||||||
|
|
||||||
|
# Tag all releases
|
||||||
|
tag: $(addprefix tag-,$(RELEASES))
|
||||||
|
|
||||||
|
# Push all releases
|
||||||
|
push: $(addprefix push-,$(RELEASES))
|
||||||
|
|
||||||
|
# Clean dangling images
|
||||||
|
clean:
|
||||||
|
docker image prune -f
|
||||||
|
|
||||||
|
# List all available releases
|
||||||
|
list:
|
||||||
|
@echo "Available releases:"
|
||||||
|
@echo $(RELEASES) | tr ' ' '\n'
|
||||||
|
|
||||||
|
# Build a specific release
|
||||||
|
build-%:
|
||||||
|
$(info Building almalinux$*-buildagent Docker image)
|
||||||
|
docker build --network=host -t $(REGISTRY)/$(OWNER)/almalinux$*-buildagent -f release/$*/Dockerfile release/$*
|
||||||
|
|
||||||
|
# Tag a specific release
|
||||||
|
tag-%:
|
||||||
|
$(info Tagging almalinux$*-buildagent Docker image)
|
||||||
|
docker tag $(REGISTRY)/$(OWNER)/almalinux$*-buildagent $(REGISTRY)/$(OWNER)/almalinux$*-buildagent:$(GIT_COMMIT)
|
||||||
|
docker tag $(REGISTRY)/$(OWNER)/almalinux$*-buildagent $(REGISTRY)/$(OWNER)/almalinux$*-buildagent:$(DATE_TAG)
|
||||||
|
docker tag $(REGISTRY)/$(OWNER)/almalinux$*-buildagent $(REGISTRY)/$(OWNER)/almalinux$*-buildagent:latest
|
||||||
|
|
||||||
|
# Push a specific release
|
||||||
|
push-%: tag-%
|
||||||
|
$(info Pushing almalinux$*-buildagent Docker image)
|
||||||
|
docker push $(REGISTRY)/$(OWNER)/almalinux$*-buildagent:$(GIT_COMMIT)
|
||||||
|
docker push $(REGISTRY)/$(OWNER)/almalinux$*-buildagent:$(DATE_TAG)
|
||||||
|
docker push $(REGISTRY)/$(OWNER)/almalinux$*-buildagent:latest
|
||||||
|
|
||||||
|
# Default target
|
||||||
|
default: build
|
||||||
@@ -1,3 +1,10 @@
|
|||||||
# docker-almalinux-buildrunner
|
# Docker Image Build: almalinux buildrunner
|
||||||
|
|
||||||
Create almalinux docker images for buildagents
|
[](https://droneci.query.consul/unkin/docker-almalinux-base)
|
||||||
|
|
||||||
|
This project provides a reproducible Docker image build process for `almalinux:8.10`, with custom YUM repository configurations and package installations. The build is automated using a `Makefile` and managed via CI tasks to ensure consistent and reliable Docker image builds.
|
||||||
|
|
||||||
|
This build includes:
|
||||||
|
- build-essentials
|
||||||
|
- nodejs:20 for actions
|
||||||
|
- make, git, rpmbuild, etc
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
# Start with the AlmaLinux 8.10 base image
|
||||||
|
FROM git.query.consul/unkin/almalinux8:latest
|
||||||
|
|
||||||
|
# Install nodejs:20 for actions
|
||||||
|
RUN dnf module enable -y nodejs:20 && \
|
||||||
|
dnf install -y nodejs
|
||||||
|
|
||||||
|
# Install build tools and dependencies for building RPMs
|
||||||
|
RUN dnf clean all && \
|
||||||
|
dnf makecache && \
|
||||||
|
dnf groupinstall -y 'Development Tools' && \
|
||||||
|
dnf install -y make cmake gcc gcc-c++ rpm rpmdevtools wget tar gzip go nfpm terragrunt terraform
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
RUN dnf clean all && \
|
||||||
|
rm -rf /var/cache/dnf
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
# Start with the AlmaLinux 9 base image
|
||||||
|
FROM git.query.consul/unkin/almalinux9:latest
|
||||||
|
|
||||||
|
# Install nodejs:20 for actions
|
||||||
|
RUN dnf module enable -y nodejs:20 && \
|
||||||
|
dnf install -y nodejs
|
||||||
|
|
||||||
|
# Install build tools and dependencies for building RPMs
|
||||||
|
RUN dnf clean all && \
|
||||||
|
dnf makecache && \
|
||||||
|
dnf groupinstall -y 'Development Tools' && \
|
||||||
|
dnf install -y make cmake gcc gcc-c++ rpm rpmdevtools wget tar gzip go nfpm terragrunt terraform
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
RUN dnf clean all && \
|
||||||
|
rm -rf /var/cache/dnf
|
||||||
Reference in New Issue
Block a user