Compare commits
12 Commits
84bd7fafd9
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 40354e381f | |||
| 68fe3847d7 | |||
| ded1f70b31 | |||
| 9491ad8c61 | |||
| bf0efbc306 | |||
| 4ee7d787f9 | |||
| c8c94f7771 | |||
| 4926c57c30 | |||
| cd2631d74c | |||
| 3a10679bdd | |||
| ab0acb586e | |||
| 33c2699896 |
-59
@@ -1,59 +0,0 @@
|
|||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: build-docker-image
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build
|
|
||||||
image: docker:dind
|
|
||||||
volumes:
|
|
||||||
- name: dockersock
|
|
||||||
path: /var/run/docker.sock
|
|
||||||
commands:
|
|
||||||
- apk add --no-cache make bash git
|
|
||||||
- make build
|
|
||||||
|
|
||||||
- name: push
|
|
||||||
image: docker:dind
|
|
||||||
environment:
|
|
||||||
DOCKER_USERNAME:
|
|
||||||
from_secret: docker_username
|
|
||||||
DOCKER_PASSWORD:
|
|
||||||
from_secret: docker_password
|
|
||||||
volumes:
|
|
||||||
- name: dockersock
|
|
||||||
path: /var/run/docker.sock
|
|
||||||
when:
|
|
||||||
branch:
|
|
||||||
- master
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
|
|
||||||
commands:
|
|
||||||
- apk add --no-cache make bash git
|
|
||||||
- echo "$DOCKER_PASSWORD" | docker login --username=$DOCKER_USERNAME --password-stdin git.query.consul
|
|
||||||
- make push
|
|
||||||
|
|
||||||
- name: clean
|
|
||||||
image: docker:dind
|
|
||||||
volumes:
|
|
||||||
- name: dockersock
|
|
||||||
path: /var/run/docker.sock
|
|
||||||
commands:
|
|
||||||
- apk add --no-cache make bash git
|
|
||||||
- make clean
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
- name: dockersock
|
|
||||||
host:
|
|
||||||
path: /var/run/docker.sock
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- pull_request
|
|
||||||
|
|
||||||
secrets:
|
|
||||||
- source: docker_username
|
|
||||||
target: DOCKER_USERNAME
|
|
||||||
- source: docker_password
|
|
||||||
target: DOCKER_PASSWORD
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
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
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
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
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
# Variables
|
||||||
|
GIT_COMMIT := $(shell git rev-parse --short HEAD)
|
||||||
|
DATE_TAG := $(shell date +%Y%m%d)
|
||||||
|
IMAGE_NAME := almalinux
|
||||||
|
REGISTRY := git.query.consul
|
||||||
|
OWNER := unkin
|
||||||
|
|
||||||
|
# List of releases (directories under ./release)
|
||||||
|
RELEASES := $(shell find release -mindepth 1 -maxdepth 1 -type d -exec basename {} \;)
|
||||||
|
|
||||||
|
# Default target (build all images)
|
||||||
|
default: build-all
|
||||||
|
|
||||||
|
# List all available releases
|
||||||
|
list:
|
||||||
|
@echo "Available releases:"
|
||||||
|
@echo $(RELEASES) | tr ' ' '\n'
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
# Build a specific release
|
||||||
|
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
|
||||||
@@ -2,5 +2,5 @@
|
|||||||
|
|
||||||
[](https://droneci.query.consul/unkin/docker-almalinux-base)
|
[](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 Drone CI to ensure consistent and reliable Docker image builds.
|
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.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
[epel]
|
|
||||||
name=epel repository
|
|
||||||
baseurl=http://edgecache.query.consul/epel/8/Everything/x86_64
|
|
||||||
gpgkey=http://edgecache.query.consul/epel/RPM-GPG-KEY-EPEL-8
|
|
||||||
enabled=1
|
|
||||||
gpgcheck=1
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
[powertools]
|
|
||||||
name=powertools repository
|
|
||||||
baseurl=http://edgecache.query.consul/almalinux/8.10/PowerTools/x86_64/os
|
|
||||||
gpgkey=http://edgecache.query.consul/almalinux/RPM-GPG-KEY-AlmaLinux-8
|
|
||||||
enabled=1
|
|
||||||
gpgcheck=1
|
|
||||||
@@ -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
|
|
||||||
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
|
|
||||||
@@ -7,12 +7,18 @@ RUN rm -rf /etc/yum.repos.d/*.repo
|
|||||||
# Copy from the local context into the container
|
# Copy from the local context into the container
|
||||||
COPY files/*.repo /etc/yum.repos.d/
|
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
|
# Clean and update the repository cache
|
||||||
RUN dnf clean all && \
|
RUN dnf clean all && \
|
||||||
dnf makecache
|
dnf makecache
|
||||||
|
|
||||||
# Update the system and install required packages
|
# Update the system and install required packages
|
||||||
RUN dnf update -y && \
|
RUN dnf update -y && \
|
||||||
dnf install -y curl git && \
|
dnf install -y curl git
|
||||||
dnf clean all && \
|
|
||||||
|
# Cleanup
|
||||||
|
RUN dnf clean all && \
|
||||||
rm -rf /var/cache/dnf
|
rm -rf /var/cache/dnf
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
[appstream]
|
||||||
|
name=appstream repository
|
||||||
|
baseurl=https://edgecache.query.consul/almalinux/8.10/AppStream/x86_64/os
|
||||||
|
gpgkey=https://edgecache.query.consul/almalinux/RPM-GPG-KEY-AlmaLinux-8
|
||||||
|
enabled=1
|
||||||
|
gpgcheck=1
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
[baseos]
|
||||||
|
name=baseos repository
|
||||||
|
baseurl=https://edgecache.query.consul/almalinux/8.10/BaseOS/x86_64/os
|
||||||
|
gpgkey=https://edgecache.query.consul/almalinux/RPM-GPG-KEY-AlmaLinux-8
|
||||||
|
enabled=1
|
||||||
|
gpgcheck=1
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
[epel]
|
||||||
|
name=epel repository
|
||||||
|
baseurl=https://edgecache.query.consul/epel/8/Everything/x86_64
|
||||||
|
gpgkey=https://edgecache.query.consul/epel/RPM-GPG-KEY-EPEL-8
|
||||||
|
enabled=1
|
||||||
|
gpgcheck=1
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
[powertools]
|
||||||
|
name=powertools repository
|
||||||
|
baseurl=https://edgecache.query.consul/almalinux/8.10/PowerTools/x86_64/os
|
||||||
|
gpgkey=https://edgecache.query.consul/almalinux/RPM-GPG-KEY-AlmaLinux-8
|
||||||
|
enabled=1
|
||||||
|
gpgcheck=1
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
[unkin]
|
||||||
|
name=unkin repository
|
||||||
|
baseurl=https://git.query.consul/api/packages/unkin/rpm/almalinux/el8
|
||||||
|
gpgkey=https://git.query.consul/api/packages/unkin/rpm/repository.key
|
||||||
|
gpgcheck=False
|
||||||
|
[unkinben]
|
||||||
|
name=unkinben repository
|
||||||
|
baseurl=https://git.query.consul/api/packages/unkinben/rpm/el8
|
||||||
|
gpgcheck=False
|
||||||
|
gpgkey=https://git.query.consul/api/packages/unkinben/rpm/repository.key
|
||||||
|
[gitea-unkin-almalimnux-8]
|
||||||
|
name=unkin - Gitea - almalimnux - 8
|
||||||
|
baseurl=https://git.query.consul/api/packages/unkin/rpm/almalimnux/8
|
||||||
|
enabled=1
|
||||||
|
gpgcheck=1
|
||||||
|
gpgkey=https://git.query.consul/api/packages/unkin/rpm/repository.key
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
# 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,6 +1,4 @@
|
|||||||
[appstream]
|
[appstream]
|
||||||
name=appstream repository
|
name=appstream repository
|
||||||
baseurl=http://edgecache.query.consul/almalinux/8.10/AppStream/x86_64/os
|
baseurl=https://edgecache.query.consul/almalinux/9.4/AppStream/x86_64/os
|
||||||
gpgkey=http://edgecache.query.consul/almalinux/RPM-GPG-KEY-AlmaLinux-8
|
gpgkey=http://edgecache.query.consul/almalinux/RPM-GPG-KEY-AlmaLinux-9
|
||||||
enabled=1
|
|
||||||
gpgcheck=1
|
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
[baseos]
|
[baseos]
|
||||||
name=baseos repository
|
name=baseos repository
|
||||||
baseurl=http://edgecache.query.consul/almalinux/8.10/BaseOS/x86_64/os
|
baseurl=https://edgecache.query.consul/almalinux/9.4/BaseOS/x86_64/os
|
||||||
gpgkey=http://edgecache.query.consul/almalinux/RPM-GPG-KEY-AlmaLinux-8
|
gpgkey=http://edgecache.query.consul/almalinux/RPM-GPG-KEY-AlmaLinux-9
|
||||||
enabled=1
|
|
||||||
gpgcheck=1
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
[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
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
[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
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
[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
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
[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
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
[unkin]
|
||||||
|
name=unkin repository
|
||||||
|
baseurl=https://git.query.consul/api/packages/unkin/rpm/almalinux/el9
|
||||||
|
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