Compare commits

...

8 Commits

Author SHA1 Message Date
unkinben 47211dce8b Merge pull request 'fix: remove unused variable' (#4) from neoloc/cleanup into master
Deploy / build (push) Successful in 1m49s
Reviewed-on: https://git.query.consul/unkin/docker-almalinux-runnerdnd/pulls/4
2024-12-20 20:25:32 +11:00
unkinben e0e971ae01 fix: remove unused variable
Build / build (pull_request) Successful in 2m18s
2024-12-20 20:21:23 +11:00
unkinben b64d043dcd Merge pull request 'feat: setup multirelease builds' (#3) from neoloc/multirelease into master
Deploy / build (push) Successful in 1m17s
Reviewed-on: https://git.query.consul/unkin/docker-almalinux-runnerdnd/pulls/3
2024-12-20 20:13:24 +11:00
unkinben 49961f7a50 feat: setup multirelease builds
Build / build (pull_request) Successful in 1m30s
- manage almalinux 8 and 9 deployments
2024-12-20 20:10:08 +11:00
unkinben 8ecbf02341 Merge pull request 'feat: add unzip' (#2) from neoloc/unzip into master
Deploy / build (push) Successful in 2m39s
Reviewed-on: https://git.query.consul/unkin/docker-almalinux-runnerdnd/pulls/2
2024-12-01 22:13:40 +11:00
unkinben 3d1298d63a feat: add unzip
Build / build (pull_request) Successful in 1m14s
- unzip is required to decompress artifacts
2024-12-01 22:11:35 +11:00
unkinben 062ec46011 Merge pull request 'feat: add runnerdnd image' (#1) from neoloc/first_image into master
Deploy / build (push) Successful in 1m3s
Reviewed-on: https://git.query.consul/unkin/docker-almalinux-runnerdnd/pulls/1
2024-12-01 12:58:36 +11:00
unkinben 6436014f85 feat: add runnerdnd image
Build / build (pull_request) Successful in 1m33s
2024-12-01 12:55:53 +11:00
4 changed files with 64 additions and 30 deletions
+35 -21
View File
@@ -1,34 +1,48 @@
# Get the current Git commit hash # Variables
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)
# Set the Docker image name and repository information
IMAGE_NAME := almalinux8-template
REGISTRY := git.query.consul REGISTRY := git.query.consul
OWNER := unkin OWNER := unkin
# Build the Docker image (without tags) # List of releases (directories under ./release)
build: RELEASES := $(shell find release -mindepth 1 -maxdepth 1 -type d -exec basename {} \;)
docker build --network=host -t $(REGISTRY)/$(OWNER)/$(IMAGE_NAME) .
# Tag the Docker image with the Git commit hash, the date, and 'latest' # Build all releases
tag: build: $(addprefix build-,$(RELEASES))
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 # Tag all releases
push: tag tag: $(addprefix tag-,$(RELEASES))
echo "template repo, not pushing"
#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 # Push all releases
push: $(addprefix push-,$(RELEASES))
# Clean dangling images
clean: clean:
docker image prune -f docker image prune -f
# List all available releases
list:
@echo "Available releases:"
@echo $(RELEASES) | tr ' ' '\n'
# Build a specific release
build-%:
$(info Building almalinux$*-runnerdnd Docker image)
docker build --network=host -t $(REGISTRY)/$(OWNER)/almalinux$*-runnerdnd -f release/$*/Dockerfile release/$*
# Tag a specific release
tag-%:
$(info Tagging almalinux$*-runnerdnd Docker image)
docker tag $(REGISTRY)/$(OWNER)/almalinux$*-runnerdnd $(REGISTRY)/$(OWNER)/almalinux$*-runnerdnd:$(GIT_COMMIT)
docker tag $(REGISTRY)/$(OWNER)/almalinux$*-runnerdnd $(REGISTRY)/$(OWNER)/almalinux$*-runnerdnd:$(DATE_TAG)
docker tag $(REGISTRY)/$(OWNER)/almalinux$*-runnerdnd $(REGISTRY)/$(OWNER)/almalinux$*-runnerdnd:latest
# Push a specific release
push-%: tag-%
$(info Pushing almalinux$*-runnerdnd Docker image)
docker push $(REGISTRY)/$(OWNER)/almalinux$*-runnerdnd:$(GIT_COMMIT)
docker push $(REGISTRY)/$(OWNER)/almalinux$*-runnerdnd:$(DATE_TAG)
docker push $(REGISTRY)/$(OWNER)/almalinux$*-runnerdnd:latest
# Default target # Default target
default: build default: build
+7 -7
View File
@@ -1,4 +1,4 @@
# Docker Image Build: Almalinux Template # Docker Image Build: Almalinux Docker-in-Docker
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 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.
@@ -16,7 +16,7 @@ To build the Docker image without tags:
make build make build
``` ```
This will use the `docker build` command with `--network=host` to build the image with the name `git.query.consul/unkin/almalinux8-template`. This will use the `docker build` command with `--network=host` to build the image with the name `git.query.consul/unkin/almalinux8-runnerdnd`.
### Tag the Docker Image ### Tag the Docker Image
@@ -27,9 +27,9 @@ make tag
``` ```
This will add three tags to the image: This will add three tags to the image:
- `git.query.consul/unkin/almalinux8-template:<GIT_COMMIT>` - `git.query.consul/unkin/almalinux8-runnerdnd:<GIT_COMMIT>`
- `git.query.consul/unkin/almalinux8-template:<DATE_TAG>` - `git.query.consul/unkin/almalinux8-runnerdnd:<DATE_TAG>`
- `git.query.consul/unkin/almalinux8-template:latest` - `git.query.consul/unkin/almalinux8-runnerdnd:latest`
### Push the Docker Image ### Push the Docker Image
@@ -67,8 +67,8 @@ To test or develop with this `Makefile`, follow these steps:
1. **Clone the repository** and navigate to the project directory: 1. **Clone the repository** and navigate to the project directory:
```bash ```bash
git clone https://git.query.consul/unkin/docker-template.git git clone https://git.query.consul/unkin/docker-almalinux-runnerdnd.git
cd docker-template cd docker-almalinux-runnerdnd
``` ```
2. **Build the Docker image** using the `build` target: 2. **Build the Docker image** using the `build` target:
+3 -2
View File
@@ -10,8 +10,9 @@ RUN dnf module enable -y nodejs:20 && \
dnf install -y nodejs dnf install -y nodejs
# Install packages # Install packages
RUN dnf groupinstall -y 'Development Tools' && \ RUN dnf install -y yum-utils && \
dnf install -y make cmake gcc gcc-c++ rpm rpmdevtools wget yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo && \
dnf install -y docker-ce-cli make bash git unzip
# Cleanup # Cleanup
RUN dnf clean all && \ RUN dnf clean all && \
+19
View File
@@ -0,0 +1,19 @@
# Start with the AlmaLinux 9 base image
FROM git.query.consul/unkin/almalinux9: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 packages
RUN dnf install -y yum-utils && \
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo && \
dnf install -y docker-ce-cli make bash git unzip
# Cleanup
RUN dnf clean all && \
rm -rf /var/cache/dnf