Compare commits
No commits in common. "ded1f70b31e5575534d6d2a4ee332a20db206611" and "bf0efbc30640f46b0f014dea0bf0e1ab9f12969b" have entirely different histories.
ded1f70b31
...
bf0efbc306
60
Makefile
60
Makefile
@ -1,49 +1,33 @@
|
|||||||
# Variables
|
# Get the current Git commit hash
|
||||||
GIT_COMMIT := $(shell git rev-parse --short HEAD)
|
GIT_COMMIT := $(shell git rev-parse --short HEAD)
|
||||||
|
|
||||||
|
# Get the current date in YYYYMMDD format
|
||||||
DATE_TAG := $(shell date +%Y%m%d)
|
DATE_TAG := $(shell date +%Y%m%d)
|
||||||
IMAGE_NAME := almalinux
|
|
||||||
|
# Set the Docker image name and repository information
|
||||||
|
IMAGE_NAME := almalinux8
|
||||||
REGISTRY := git.query.consul
|
REGISTRY := git.query.consul
|
||||||
OWNER := unkin
|
OWNER := unkin
|
||||||
|
|
||||||
# List of releases (directories under ./release)
|
# Build the Docker image (without tags)
|
||||||
RELEASES := $(shell find release -mindepth 1 -maxdepth 1 -type d -exec basename {} \;)
|
build:
|
||||||
|
docker build --network=host -t $(REGISTRY)/$(OWNER)/$(IMAGE_NAME) .
|
||||||
|
|
||||||
# Default target (build all images)
|
# Tag the Docker image with the Git commit hash, the date, and 'latest'
|
||||||
default: build-all
|
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
|
||||||
|
|
||||||
# List all available releases
|
# Push the Docker image to a repository with all tags
|
||||||
list:
|
push: tag
|
||||||
@echo "Available releases:"
|
docker push $(REGISTRY)/$(OWNER)/$(IMAGE_NAME):$(GIT_COMMIT)
|
||||||
@echo $(RELEASES) | tr ' ' '\n'
|
docker push $(REGISTRY)/$(OWNER)/$(IMAGE_NAME):$(DATE_TAG)
|
||||||
|
docker push $(REGISTRY)/$(OWNER)/$(IMAGE_NAME):latest
|
||||||
|
|
||||||
# Build all releases
|
# Clean up dangling Docker images
|
||||||
build: $(addprefix build-,$(RELEASES))
|
|
||||||
|
|
||||||
# Tag all releases
|
|
||||||
tag: $(addprefix tag-,$(RELEASES))
|
|
||||||
|
|
||||||
# Push all releases
|
|
||||||
push: $(addprefix push-,$(RELEASES))
|
|
||||||
|
|
||||||
# Clean dangling images
|
|
||||||
clean:
|
clean:
|
||||||
docker image prune -f
|
docker image prune -f
|
||||||
|
|
||||||
# Build a specific release
|
# Default target
|
||||||
build-%:
|
default: build
|
||||||
$(info Building AlmaLinux $* Docker image)
|
|
||||||
docker build --network=host -t $(REGISTRY)/$(OWNER)/$(IMAGE_NAME)$* -f release/$*/Dockerfile release/$*
|
|
||||||
|
|
||||||
# Tag a specific release
|
|
||||||
tag-%:
|
|
||||||
$(info Tagging AlmaLinux $* Docker image)
|
|
||||||
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 a specific release
|
|
||||||
push-%: tag-%
|
|
||||||
$(info Pushing AlmaLinux $* Docker image)
|
|
||||||
docker push $(REGISTRY)/$(OWNER)/$(IMAGE_NAME)$*:$(GIT_COMMIT)
|
|
||||||
docker push $(REGISTRY)/$(OWNER)/$(IMAGE_NAME)$*:$(DATE_TAG)
|
|
||||||
docker push $(REGISTRY)/$(OWNER)/$(IMAGE_NAME)$*:latest
|
|
||||||
|
|||||||
@ -1,24 +0,0 @@
|
|||||||
# Start with the base AlmaLinux 9.4 image
|
|
||||||
FROM almalinux:9.4
|
|
||||||
|
|
||||||
# Remove existing repos and copy custom repo files into the container
|
|
||||||
RUN rm -rf /etc/yum.repos.d/*.repo
|
|
||||||
|
|
||||||
# Copy from the local context into the container
|
|
||||||
COPY files/*.repo /etc/yum.repos.d/
|
|
||||||
|
|
||||||
# Install ca-certs
|
|
||||||
RUN curl -k -o internal-ca-certificates.rpm https://git.query.consul/unkin/-/packages/rpm/internal-ca-certificates/20240825-1.el8/files/756 && \
|
|
||||||
rpm -i internal-ca-certificates.rpm
|
|
||||||
|
|
||||||
# Clean and update the repository cache
|
|
||||||
RUN dnf clean all && \
|
|
||||||
dnf makecache
|
|
||||||
|
|
||||||
# Update the system and install required packages
|
|
||||||
RUN dnf update -y && \
|
|
||||||
dnf install -y curl-minimal git
|
|
||||||
|
|
||||||
# Cleanup
|
|
||||||
RUN dnf clean all && \
|
|
||||||
rm -rf /var/cache/dnf
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
[appstream]
|
|
||||||
name=appstream repository
|
|
||||||
baseurl=https://edgecache.query.consul/almalinux/9.4/AppStream/x86_64/os
|
|
||||||
gpgkey=http://edgecache.query.consul/almalinux/RPM-GPG-KEY-AlmaLinux-9
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
[baseos]
|
|
||||||
name=baseos repository
|
|
||||||
baseurl=https://edgecache.query.consul/almalinux/9.4/BaseOS/x86_64/os
|
|
||||||
gpgkey=http://edgecache.query.consul/almalinux/RPM-GPG-KEY-AlmaLinux-9
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
[crb]
|
|
||||||
name=crb repository
|
|
||||||
baseurl=https://edgecache.query.consul/almalinux/9.4/CRB/x86_64/os
|
|
||||||
gpgkey=http://edgecache.query.consul/almalinux/RPM-GPG-KEY-AlmaLinux-9
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
[epel]
|
|
||||||
name=epel repository
|
|
||||||
baseurl=https://edgecache.query.consul/epel/9/Everything/x86_64
|
|
||||||
gpgkey=http://edgecache.query.consul/epel/RPM-GPG-KEY-EPEL-9
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
[extras]
|
|
||||||
name=extras repository
|
|
||||||
baseurl=https://edgecache.query.consul/almalinux/9.4/extras/x86_64/os
|
|
||||||
gpgkey=http://edgecache.query.consul/almalinux/RPM-GPG-KEY-AlmaLinux-9
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
[highavailability]
|
|
||||||
name=highavailability repository
|
|
||||||
baseurl=https://edgecache.query.consul/almalinux/9.4/HighAvailability/x86_64/os
|
|
||||||
gpgkey=http://edgecache.query.consul/almalinux/RPM-GPG-KEY-AlmaLinux-9
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
[unkin]
|
|
||||||
name=unkin repository
|
|
||||||
baseurl=https://git.query.consul/api/packages/unkin/rpm/almalinux/el8
|
|
||||||
gpgcheck=False
|
|
||||||
gpgkey=https://git.query.consul/api/packages/unkin/rpm/repository.key
|
|
||||||
[unkinben]
|
|
||||||
name=unkinben repository
|
|
||||||
baseurl=https://git.query.consul/api/packages/unkinben/rpm/el9
|
|
||||||
gpgcheck=False
|
|
||||||
gpgkey=https://git.query.consul/api/packages/unkinben/rpm/repository.key
|
|
||||||
Reference in New Issue
Block a user