Compare commits
No commits in common. "e0fee84e6501d28133e90d6df2e4c9ca49834e01" and "0d3e7553ef0e146a12aa581d722f333c55e91d2e" have entirely different histories.
e0fee84e65
...
0d3e7553ef
@ -1,26 +0,0 @@
|
|||||||
name: Build
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: almalinux-8
|
|
||||||
container:
|
|
||||||
image: git.query.consul/unkin/almalinux8:latest
|
|
||||||
options: --privileged
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Set up environment
|
|
||||||
run: |
|
|
||||||
dnf install -y yum-utils
|
|
||||||
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
|
|
||||||
dnf module enable -y nodejs:20
|
|
||||||
dnf install -y docker-ce-cli make bash git nodejs
|
|
||||||
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Build Docker Image
|
|
||||||
run: |
|
|
||||||
make build
|
|
||||||
@ -1,39 +0,0 @@
|
|||||||
name: Deploy
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: almalinux-8
|
|
||||||
container:
|
|
||||||
image: git.query.consul/unkin/almalinux8:latest
|
|
||||||
options: --privileged
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Set up environment
|
|
||||||
run: |
|
|
||||||
dnf install -y yum-utils
|
|
||||||
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
|
|
||||||
dnf module enable -y nodejs:20
|
|
||||||
dnf install -y docker-ce-cli make bash git nodejs
|
|
||||||
|
|
||||||
- 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
|
|
||||||
18
Dockerfile
18
Dockerfile
@ -1,18 +0,0 @@
|
|||||||
# 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
|
|
||||||
RUN dnf groupinstall -y 'Development Tools' && \
|
|
||||||
dnf install -y make cmake gcc gcc-c++ rpm rpmdevtools wget
|
|
||||||
|
|
||||||
# Cleanup
|
|
||||||
RUN dnf clean all && \
|
|
||||||
rm -rf /var/cache/dnf
|
|
||||||
33
Makefile
33
Makefile
@ -1,33 +0,0 @@
|
|||||||
# Get the current Git commit hash
|
|
||||||
GIT_COMMIT := $(shell git rev-parse --short HEAD)
|
|
||||||
|
|
||||||
# Get the current date in YYYYMMDD format
|
|
||||||
DATE_TAG := $(shell date +%Y%m%d)
|
|
||||||
|
|
||||||
# Set the Docker image name and repository information
|
|
||||||
IMAGE_NAME := almalinux8-buildagent
|
|
||||||
REGISTRY := git.query.consul
|
|
||||||
OWNER := unkin
|
|
||||||
|
|
||||||
# Build the Docker image (without tags)
|
|
||||||
build:
|
|
||||||
docker build --network=host -t $(REGISTRY)/$(OWNER)/$(IMAGE_NAME) .
|
|
||||||
|
|
||||||
# Tag the Docker image with the Git commit hash, the date, and 'latest'
|
|
||||||
tag:
|
|
||||||
docker tag $(REGISTRY)/$(OWNER)/$(IMAGE_NAME) $(REGISTRY)/$(OWNER)/$(IMAGE_NAME):$(GIT_COMMIT)
|
|
||||||
docker tag $(REGISTRY)/$(OWNER)/$(IMAGE_NAME) $(REGISTRY)/$(OWNER)/$(IMAGE_NAME):$(DATE_TAG)
|
|
||||||
docker tag $(REGISTRY)/$(OWNER)/$(IMAGE_NAME) $(REGISTRY)/$(OWNER)/$(IMAGE_NAME):latest
|
|
||||||
|
|
||||||
# Push the Docker image to a repository with all tags
|
|
||||||
push: tag
|
|
||||||
docker push $(REGISTRY)/$(OWNER)/$(IMAGE_NAME):$(GIT_COMMIT)
|
|
||||||
docker push $(REGISTRY)/$(OWNER)/$(IMAGE_NAME):$(DATE_TAG)
|
|
||||||
docker push $(REGISTRY)/$(OWNER)/$(IMAGE_NAME):latest
|
|
||||||
|
|
||||||
# Clean up dangling Docker images
|
|
||||||
clean:
|
|
||||||
docker image prune -f
|
|
||||||
|
|
||||||
# Default target
|
|
||||||
default: build
|
|
||||||
11
README.md
11
README.md
@ -1,10 +1,3 @@
|
|||||||
# Docker Image Build: almalinux buildrunner
|
# docker-almalinux-buildrunner
|
||||||
|
|
||||||
[](https://droneci.query.consul/unkin/docker-almalinux-base)
|
Create almalinux docker images for buildagents
|
||||||
|
|
||||||
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
|
|
||||||
Reference in New Issue
Block a user