feat: build base image for rh8

This commit is contained in:
Robert Kaussow 2021-10-23 15:53:49 +02:00
parent 06fa93f388
commit dd7d469e2c
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
6 changed files with 438 additions and 135 deletions

183
.drone.jsonnet Normal file
View File

@ -0,0 +1,183 @@
local PipelineTest = {
kind: 'pipeline',
name: 'test',
platform: {
os: 'linux',
arch: 'amd64',
},
steps: [
{
name: 'markdownlint',
image: 'thegeeklab/markdownlint-cli',
commands: [
"markdownlint 'README.md'",
],
},
],
trigger: {
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
},
};
local PipelineBuildContainer(version='7') = {
kind: 'pipeline',
name: 'build-container-rh' + version,
platform: {
os: 'linux',
arch: 'amd64',
},
steps: [
{
name: 'dryrun',
image: 'thegeeklab/drone-docker-buildx:20',
pull: 'always',
settings: {
dry_run: true,
dockerfile: 'Dockerfile.rh' + version,
repo: 'thegeeklab/${DRONE_REPO_NAME}',
},
depends_on: ['tags'],
when: {
ref: ['refs/pull/**'],
},
},
{
name: 'publish-dockerhub',
image: 'thegeeklab/drone-docker-buildx:20',
pull: 'always',
settings: {
dockerfile: 'Dockerfile.rh' + version,
repo: 'thegeeklab/${DRONE_REPO_NAME}',
username: { from_secret: 'docker_username' },
password: { from_secret: 'docker_password' },
},
when: {
ref: ['refs/heads/main', 'refs/tags/**'],
},
depends_on: ['tags'],
},
{
name: 'publish-quay',
image: 'thegeeklab/drone-docker-buildx:20',
pull: 'always',
settings: {
dockerfile: 'Dockerfile.rh' + version,
registry: 'quay.io',
repo: 'quay.io/thegeeklab/${DRONE_REPO_NAME}',
username: { from_secret: 'quay_username' },
password: { from_secret: 'quay_password' },
},
when: {
ref: ['refs/heads/main', 'refs/tags/**'],
},
depends_on: ['tags'],
},
],
depends_on: [
'test',
],
trigger: {
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
},
};
local PipelineNotifications = {
kind: 'pipeline',
name: 'notifications',
platform: {
os: 'linux',
arch: 'amd64',
},
steps: [
{
image: 'plugins/manifest',
name: 'manifest-dockerhub',
settings: {
ignore_missing: true,
username: { from_secret: 'docker_username' },
password: { from_secret: 'docker_password' },
spec: 'manifest.tmpl',
},
when: {
status: ['success'],
},
},
{
image: 'plugins/manifest',
name: 'manifest-quay',
settings: {
ignore_missing: true,
username: { from_secret: 'quay_username' },
password: { from_secret: 'quay_password' },
spec: 'manifest-quay.tmpl',
},
when: {
status: ['success'],
},
},
{
name: 'pushrm-dockerhub',
pull: 'always',
image: 'chko/docker-pushrm:1',
environment: {
DOCKER_PASS: {
from_secret: 'docker_password',
},
DOCKER_USER: {
from_secret: 'docker_username',
},
PUSHRM_FILE: 'README.md',
PUSHRM_SHORT: 'Rootless Alpine base image',
PUSHRM_TARGET: 'thegeeklab/${DRONE_REPO_NAME}',
},
when: {
status: ['success'],
},
},
{
name: 'pushrm-quay',
pull: 'always',
image: 'chko/docker-pushrm:1',
environment: {
APIKEY__QUAY_IO: {
from_secret: 'quay_token',
},
PUSHRM_FILE: 'README.md',
PUSHRM_TARGET: 'quay.io/thegeeklab/${DRONE_REPO_NAME}',
},
when: {
status: ['success'],
},
},
{
name: 'matrix',
image: 'thegeeklab/drone-matrix',
settings: {
homeserver: { from_secret: 'matrix_homeserver' },
roomid: { from_secret: 'matrix_roomid' },
template: 'Status: **{{ build.Status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.Link }}){{#if build.Branch}} ({{ build.Branch }}){{/if}} by {{ commit.Author }}<br/> Message: {{ commit.Message.Title }}',
username: { from_secret: 'matrix_username' },
password: { from_secret: 'matrix_password' },
},
when: {
status: ['success', 'failure'],
},
},
],
depends_on: [
'build-container-amd64',
'build-container-arm64',
'build-container-arm',
],
trigger: {
ref: ['refs/heads/main', 'refs/tags/**'],
status: ['success', 'failure'],
},
};
[
PipelineTest,
PipelineBuildContainer(version='7'),
PipelineBuildContainer(version='8'),
PipelineNotifications,
]

View File

@ -15,12 +15,12 @@ steps:
trigger: trigger:
ref: ref:
- refs/heads/main - refs/heads/main
- refs/pull/**
- refs/tags/** - refs/tags/**
- refs/pull/**
--- ---
kind: pipeline kind: pipeline
name: build-container name: build-container-rh7
platform: platform:
os: linux os: linux
@ -28,37 +28,23 @@ platform:
steps: steps:
- name: dryrun - name: dryrun
pull: always
image: thegeeklab/drone-docker-buildx:20 image: thegeeklab/drone-docker-buildx:20
settings: settings:
dockerfile: Dockerfile dockerfile: Dockerfile.rh7
dry_run: true dry_run: true
password:
from_secret: docker_password
repo: thegeeklab/${DRONE_REPO_NAME} repo: thegeeklab/${DRONE_REPO_NAME}
username:
from_secret: docker_username
when: when:
ref: ref:
- refs/pull/** - refs/pull/**
- name: tags
image: thegeeklab/docker-autotag
environment:
DOCKER_AUTOTAG_FORCE_LATEST: True
DOCKER_AUTOTAG_IGNORE_PRERELEASE: True
DOCKER_AUTOTAG_OUTPUT_FILE: .tags
DOCKER_AUTOTAG_VERSION: ${DRONE_TAG}
when:
ref:
- refs/heads/main
- refs/tags/**
depends_on: depends_on:
- dryrun - tags
- name: publish-dockerhub - name: publish-dockerhub
pull: always
image: thegeeklab/drone-docker-buildx:20 image: thegeeklab/drone-docker-buildx:20
settings: settings:
dockerfile: Dockerfile dockerfile: Dockerfile.rh7
password: password:
from_secret: docker_password from_secret: docker_password
repo: thegeeklab/${DRONE_REPO_NAME} repo: thegeeklab/${DRONE_REPO_NAME}
@ -72,9 +58,10 @@ steps:
- tags - tags
- name: publish-quay - name: publish-quay
pull: always
image: thegeeklab/drone-docker-buildx:20 image: thegeeklab/drone-docker-buildx:20
settings: settings:
dockerfile: Dockerfile dockerfile: Dockerfile.rh7
password: password:
from_secret: quay_password from_secret: quay_password
registry: quay.io registry: quay.io
@ -88,27 +75,77 @@ steps:
depends_on: depends_on:
- tags - tags
- name: publish-gitea trigger:
image: plugins/gitea-release ref:
- refs/heads/main
- refs/tags/**
- refs/pull/**
depends_on:
- test
---
kind: pipeline
name: build-container-rh8
platform:
os: linux
arch: amd64
steps:
- name: dryrun
pull: always
image: thegeeklab/drone-docker-buildx:20
settings: settings:
api_key: dockerfile: Dockerfile.rh8
from_secret: gitea_token dry_run: true
base_url: https://gitea.rknet.org repo: thegeeklab/${DRONE_REPO_NAME}
note: CHANGELOG.md
overwrite: true
title: ${DRONE_TAG}
when: when:
ref: ref:
- refs/pull/**
depends_on:
- tags
- name: publish-dockerhub
pull: always
image: thegeeklab/drone-docker-buildx:20
settings:
dockerfile: Dockerfile.rh8
password:
from_secret: docker_password
repo: thegeeklab/${DRONE_REPO_NAME}
username:
from_secret: docker_username
when:
ref:
- refs/heads/main
- refs/tags/** - refs/tags/**
depends_on: depends_on:
- publish-dockerhub - tags
- publish-quay
- name: publish-quay
pull: always
image: thegeeklab/drone-docker-buildx:20
settings:
dockerfile: Dockerfile.rh8
password:
from_secret: quay_password
registry: quay.io
repo: quay.io/thegeeklab/${DRONE_REPO_NAME}
username:
from_secret: quay_username
when:
ref:
- refs/heads/main
- refs/tags/**
depends_on:
- tags
trigger: trigger:
ref: ref:
- refs/heads/main - refs/heads/main
- refs/pull/**
- refs/tags/** - refs/tags/**
- refs/pull/**
depends_on: depends_on:
- test - test
@ -122,6 +159,32 @@ platform:
arch: amd64 arch: amd64
steps: steps:
- name: manifest-dockerhub
image: plugins/manifest
settings:
ignore_missing: true
password:
from_secret: docker_password
spec: manifest.tmpl
username:
from_secret: docker_username
when:
status:
- success
- name: manifest-quay
image: plugins/manifest
settings:
ignore_missing: true
password:
from_secret: quay_password
spec: manifest-quay.tmpl
username:
from_secret: quay_username
when:
status:
- success
- name: pushrm-dockerhub - name: pushrm-dockerhub
pull: always pull: always
image: chko/docker-pushrm:1 image: chko/docker-pushrm:1
@ -131,7 +194,7 @@ steps:
DOCKER_USER: DOCKER_USER:
from_secret: docker_username from_secret: docker_username
PUSHRM_FILE: README.md PUSHRM_FILE: README.md
PUSHRM_SHORT: CentOS 7 image to build RPM packages PUSHRM_SHORT: Rootless Alpine base image
PUSHRM_TARGET: thegeeklab/${DRONE_REPO_NAME} PUSHRM_TARGET: thegeeklab/${DRONE_REPO_NAME}
when: when:
status: status:
@ -150,7 +213,7 @@ steps:
- success - success
- name: matrix - name: matrix
image: plugins/matrix image: thegeeklab/drone-matrix
settings: settings:
homeserver: homeserver:
from_secret: matrix_homeserver from_secret: matrix_homeserver
@ -158,7 +221,7 @@ steps:
from_secret: matrix_password from_secret: matrix_password
roomid: roomid:
from_secret: matrix_roomid from_secret: matrix_roomid
template: "Status: **{{ build.status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}<br/> Message: {{ build.message }}" template: "Status: **{{ build.Status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.Link }}){{#if build.Branch}} ({{ build.Branch }}){{/if}} by {{ commit.Author }}<br/> Message: {{ commit.Message.Title }}"
username: username:
from_secret: matrix_username from_secret: matrix_username
when: when:
@ -175,10 +238,12 @@ trigger:
- failure - failure
depends_on: depends_on:
- build-container - build-container-amd64
- build-container-arm64
- build-container-arm
--- ---
kind: signature kind: signature
hmac: f3a932f626d5aab6054e52d4419f9b6eacd25e52dec3ab9a9f0335acd5433e73 hmac: 2b3a8b24f8cd073563d652dbad1ca02eb0cc7a41d666b0891bf7f5c268214362
... ...

51
Dockerfile.rh8 Normal file
View File

@ -0,0 +1,51 @@
FROM rockylinux/rockylinux:8
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
LABEL org.opencontainers.image.title="rpmbuild"
LABEL org.opencontainers.image.url="https://gitea.rknet.org/docker/rpmbuild"
LABEL org.opencontainers.image.source="https://gitea.rknet.org/docker/rpmbuild"
LABEL org.opencontainers.image.documentation="https://gitea.rknet.org/docker/rpmbuild"
ENV RPMBUILD_BASE_DIR=/drone/src
RUN yum install -q -y \
dash \
ca-certificates \
gcc gcc-c++ \
gnutls \
gnutls-devel \
libtool libtool-ltdl \
pam-devel \
dbus-devel \
avahi-devel \
systemd-devel \
make cmake \
git \
bzip2 \
bzip2-devel \
freetype-devel \
fribidi-devel \
expat-devel \
gperf \
nasm \
perl \
python \
yasm \
which \
libva-devel \
zlib-devel \
pkgconfig \
wget curl \
automake autoconf \
yum-utils rpm-build rpmdevtools \
epel-release && \
rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-8 && \
yum clean all
ADD overlay/ /
USER root
WORKDIR ${RPMBUILD_BASE_DIR}
CMD []

View File

@ -1,6 +1,6 @@
# rpmbuild # rpmbuild
CentOS 7 image to build RPM packages Base image to build RPM packages
[![Build Status](https://img.shields.io/drone/build/docker/rpmbuild?logo=drone&server=https%3A%2F%2Fdrone.rknet.org)](https://drone.rknet.org/docker/rpmbuild) [![Build Status](https://img.shields.io/drone/build/docker/rpmbuild?logo=drone&server=https%3A%2F%2Fdrone.rknet.org)](https://drone.rknet.org/docker/rpmbuild)
[![Docker Hub](https://img.shields.io/badge/dockerhub-latest-blue.svg?logo=docker&logoColor=white)](https://hub.docker.com/r/thegeeklab/rpmbuild) [![Docker Hub](https://img.shields.io/badge/dockerhub-latest-blue.svg?logo=docker&logoColor=white)](https://hub.docker.com/r/thegeeklab/rpmbuild)
@ -8,7 +8,7 @@ CentOS 7 image to build RPM packages
[![Source: Gitea](https://img.shields.io/badge/source-gitea-blue.svg?logo=gitea&logoColor=white)](https://gitea.rknet.org/docker/rpmbuild) [![Source: Gitea](https://img.shields.io/badge/source-gitea-blue.svg?logo=gitea&logoColor=white)](https://gitea.rknet.org/docker/rpmbuild)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://gitea.rknet.org/docker/rpmbuild/src/branch/main/LICENSE) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://gitea.rknet.org/docker/rpmbuild/src/branch/main/LICENSE)
Simple Docker image based on CentOS 7 to build RPM packages. Simple Docker images based on CentOS 7/Rocky Linux 8 to build RPM packages.
## Environment variables ## Environment variables

4
renovate.json Normal file
View File

@ -0,0 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>thegeeklab/renovate-presets:docker"]
}