feat: build base image for rh8 #2

Merged
xoxys merged 7 commits from add-rh8 into main 2021-10-23 14:16:55 +00:00
6 changed files with 432 additions and 138 deletions

180
.drone.jsonnet Normal file
View File

@ -0,0 +1,180 @@
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}',
},
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/**'],
},
},
{
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' },
tags: version,
},
when: {
ref: ['refs/heads/main', 'refs/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-rh7',
'build-container-rh8',
],
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:
ref:
- refs/heads/main
- refs/pull/**
- refs/tags/**
- refs/pull/**
---
kind: pipeline
name: build-container
name: build-container-rh7
platform:
os: linux
@ -28,37 +28,21 @@ platform:
steps:
- name: dryrun
pull: always
image: thegeeklab/drone-docker-buildx:20
settings:
dockerfile: Dockerfile
dockerfile: Dockerfile.rh7
dry_run: true
password:
from_secret: docker_password
repo: thegeeklab/${DRONE_REPO_NAME}
username:
from_secret: docker_username
when:
ref:
- 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:
- dryrun
- name: publish-dockerhub
pull: always
image: thegeeklab/drone-docker-buildx:20
settings:
dockerfile: Dockerfile
dockerfile: Dockerfile.rh7
password:
from_secret: docker_password
repo: thegeeklab/${DRONE_REPO_NAME}
@ -68,47 +52,90 @@ steps:
ref:
- refs/heads/main
- refs/tags/**
depends_on:
- tags
- name: publish-quay
pull: always
image: thegeeklab/drone-docker-buildx:20
settings:
dockerfile: Dockerfile
dockerfile: Dockerfile.rh7
password:
from_secret: quay_password
registry: quay.io
repo: quay.io/thegeeklab/${DRONE_REPO_NAME}
tags: 7
username:
from_secret: quay_username
when:
ref:
- refs/heads/main
- refs/tags/**
depends_on:
- tags
- name: publish-gitea
image: plugins/gitea-release
settings:
api_key:
from_secret: gitea_token
base_url: https://gitea.rknet.org
note: CHANGELOG.md
overwrite: true
title: ${DRONE_TAG}
when:
ref:
- refs/tags/**
depends_on:
- publish-dockerhub
- publish-quay
trigger:
ref:
- refs/heads/main
- refs/pull/**
- 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:
dockerfile: Dockerfile.rh8
dry_run: true
repo: thegeeklab/${DRONE_REPO_NAME}
when:
ref:
- refs/pull/**
- 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/**
- 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}
tags: 8
username:
from_secret: quay_username
when:
ref:
- refs/heads/main
- refs/tags/**
trigger:
ref:
- refs/heads/main
- refs/tags/**
- refs/pull/**
depends_on:
- test
@ -122,6 +149,32 @@ platform:
arch: amd64
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
pull: always
image: chko/docker-pushrm:1
@ -131,7 +184,7 @@ steps:
DOCKER_USER:
from_secret: docker_username
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}
when:
status:
@ -150,7 +203,7 @@ steps:
- success
- name: matrix
image: plugins/matrix
image: thegeeklab/drone-matrix
settings:
homeserver:
from_secret: matrix_homeserver
@ -158,7 +211,7 @@ steps:
from_secret: matrix_password
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:
from_secret: matrix_username
when:
@ -175,10 +228,11 @@ trigger:
- failure
depends_on:
- build-container
- build-container-rh7
- build-container-rh8
---
kind: signature
hmac: f3a932f626d5aab6054e52d4419f9b6eacd25e52dec3ab9a9f0335acd5433e73
hmac: 474bbbb50ad73c8e3fb3c9047caabeefaf91f311582963e508503405b652af5d
...

View File

@ -9,6 +9,10 @@ LABEL org.opencontainers.image.documentation="https://gitea.rknet.org/docker/rpm
ENV RPMBUILD_BASE_DIR=/drone/src
RUN yum install -q -y \
epel-release \
yum-utils && \
rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7
RUN yum install -q -y \
dash \
ca-certificates \
@ -38,9 +42,7 @@ RUN yum install -q -y \
pkgconfig \
wget curl \
automake autoconf \
yum-utils rpm-build rpmdevtools \
epel-release && \
rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7 && \
rpm-build rpmdevtools && \
yum clean all
ADD overlay/ /

54
Dockerfile.rh8 Normal file
View File

@ -0,0 +1,54 @@
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 dnf install -q -y \
epel-release \
dnf-utils dnf-plugins-core && \
rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7 && \
dnf config-manager --set-enabled powertools
RUN dnf 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 \
python3 \
yasm \
which \
libva-devel \
zlib-devel \
pkgconfig \
wget curl \
automake autoconf \
rpm-build rpmdevtools && \
dnf clean all
ADD overlay/ /
USER root
WORKDIR ${RPMBUILD_BASE_DIR}
CMD []

View File

@ -1,6 +1,6 @@
# 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)
[![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)
[![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

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"]
}