Compare commits

...

31 Commits
v0.1.0 ... dev

Author SHA1 Message Date
489a1d3404
dockerfile: add proper OCI annotations
All checks were successful
continuous-integration/drone/push Build is passing
2022-10-10 16:34:01 +02:00
ea93c12d9e
bump fedora to version 36
All checks were successful
continuous-integration/drone/push Build is passing
2022-05-16 16:24:52 +02:00
f1754e6e32
ci,makefile: bump hadolint to v2.10.0
All checks were successful
continuous-integration/drone/push Build is passing
2022-04-30 16:26:27 +02:00
1760f6e6cf
add pre-commit-config.yaml
All checks were successful
continuous-integration/drone/push Build is passing
2022-04-21 16:40:33 +02:00
e61c76b1a8
fix: hadolint vol mount for SELinux-enabled hosts
All checks were successful
continuous-integration/drone/push Build is passing
2022-04-21 14:22:58 +02:00
8e7d186259
fix: kaniko vol mount for SELinux-enabled systems
All checks were successful
continuous-integration/drone/push Build is passing
2022-04-21 14:22:00 +02:00
7516b21702
makefile: bump kaniko executor to v1.8.1-debug
All checks were successful
continuous-integration/drone/push Build is passing
2022-04-21 14:20:47 +02:00
d1518f11b7
makefile: separate hadolint tag into its own var
All checks were successful
continuous-integration/drone/push Build is passing
2022-03-24 18:00:08 +01:00
3bb4950e8e
makefile: bump kaniko executor to v1.8.0-debug
All checks were successful
continuous-integration/drone/push Build is passing
2022-03-24 17:57:46 +01:00
edc88ff5e4
refactor(dockerfile): consolidate consecutive RUNs
All checks were successful
continuous-integration/drone/push Build is passing
.. to achieve faster builds
2022-03-24 17:56:35 +01:00
5337a03c11
ci,makefile: bump hadolint to v2.9.3
All checks were successful
continuous-integration/drone/push Build is passing
2022-03-24 17:21:29 +01:00
a841268fa5
feat: bump base image to fedora-minimal:35
commit b37613c3aa6260740c92c6f49d517f2dc89e4020
Author: surtur <a_mirre@utb.cz>
Date:   Mon Jan 10 01:46:21 2022 +0100

    chore: update README to reflect bump to f35

    [skip ci]

commit 7c2214e3c1e508daaac71398f09fe523d8589bd4
Author: surtur <a_mirre@utb.cz>
Date:   Thu Oct 21 01:15:51 2021 +0200

    switch to fedora-minimal

    use microdnf as a consequence

commit 149781968b9c9845159554e99efc9ea8fc4a4a66
Author: surtur <a_mirre@utb.cz>
Date:   Wed Oct 20 00:07:54 2021 +0200

    bump fedora version to 35

    also update README.md
2022-01-10 01:48:56 +01:00
1fa322a2c9
add thread sanitizer
All checks were successful
continuous-integration/drone/push Build is passing
2022-01-10 01:24:18 +01:00
9e0d34a88f
add iwyu (from copr)
All checks were successful
continuous-integration/drone/push Build is passing
2022-01-07 18:28:47 +01:00
8bcea33137
add sanitizers
All checks were successful
continuous-integration/drone/push Build is passing
address sanitizer
leak sanitizer
undefined-behaviour sanitizer

install both dynamic and static
2021-11-28 16:37:19 +01:00
3eaed7cdae
chore: also include cryptopp-devel
All checks were successful
continuous-integration/drone/push Build is passing
2021-11-11 02:49:10 +01:00
91636b4219
add lld
All checks were successful
continuous-integration/drone/push Build is passing
2021-11-01 08:42:43 +01:00
4bd15e92c8
dockerfile: switch to fedora-minimal
All checks were successful
continuous-integration/drone/push Build is passing
* source the image from fedoraproject's container repository
* edit Dockerfile to use microdnf as dnf is unavailable in -minimal
  images
* instruct microdnf to not install weak deps or docs
* update image info in README.md
2021-10-21 01:42:13 +02:00
ea744cebe5
chore(makefile): bump kaniko to 1.7.0
[skip ci]
2021-10-21 00:55:18 +02:00
ce9dc1e158
add ninja build system
All checks were successful
continuous-integration/drone/push Build is passing
2021-10-19 23:45:41 +02:00
4d3312564e
fix(kaniko): supply build args {in ci,locally}
All checks were successful
continuous-integration/drone/push Build is passing
since the switch to kaniko as a container image builder, proper
BUILD_DATE and VCS_REF values previously filled in by a build hook were
left empty. that changes now.

fixes #3
2021-10-19 22:47:25 +02:00
8fc21d6fde
dockerfile: bump frontend to version 1.3
All checks were successful
continuous-integration/drone/push Build is passing
2021-10-19 21:35:05 +02:00
c42387d7ee
makefile: switch to cgroupsv2-aware kaniko build
as a consequence, we no longer need to override using "--force".
works with both recent podman and docker (>=v20.x)

[skip ci]
2021-10-19 21:33:53 +02:00
b2ee470ff1
add "/usr/local/lib" in path of the linker
All checks were successful
continuous-integration/drone/push Build is passing
2021-08-13 03:40:49 +02:00
434e69e83e
dnf: optimise dowload speed, possibly save storage
All checks were successful
continuous-integration/drone/push Build is passing
2021-08-13 03:28:55 +02:00
892564909c
fix(ci): run cron builds
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-17 23:15:06 +02:00
bdfd8af631
dockerfile: separate upgrade and install steps
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-16 14:30:46 +02:00
b7679ef08e
dnf: install numa devel and libs packages
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-16 14:15:05 +02:00
c7de2a834c
readme: microbadger is no more [skip ci]
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-16 13:43:37 +02:00
8ef5fc9686
dnf: install packages without docs
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-16 13:38:42 +02:00
81860b9567
ndpi: use both dev branch and 1.7 (#2)
All checks were successful
continuous-integration/drone/push Build is passing
have a more recent version of nDPI available

keep 1.7 for backward compatibility (until it's not needed) but also include a build from the dev branch (this might even be unstable at times)

Reviewed-on: #2
Co-authored-by: wanderer <wanderer@noreply.git.dotya.ml>
Co-committed-by: wanderer <wanderer@noreply.git.dotya.ml>
2021-05-07 04:15:05 +02:00
6 changed files with 110 additions and 34 deletions

@ -10,7 +10,7 @@ platform:
steps: steps:
- name: hadolint - name: hadolint
pull: always pull: always
image: hadolint/hadolint:v1.23.0-8-gb01c5a9-alpine image: hadolint/hadolint:v2.10.0-alpine
commands: commands:
- hadolint --version - hadolint --version
- hadolint Dockerfile - hadolint Dockerfile
@ -29,6 +29,9 @@ steps:
settings: settings:
dockerfile: Dockerfile dockerfile: Dockerfile
context: . context: .
args:
- BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
- VCS_REF=${DRONE_COMMIT_SHA:0:7}
when: when:
ref: ref:
- "refs/heads/feature-**" - "refs/heads/feature-**"
@ -43,6 +46,9 @@ steps:
settings: settings:
dockerfile: Dockerfile dockerfile: Dockerfile
context: . context: .
args:
- BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
- VCS_REF=${DRONE_COMMIT_SHA:0:7}
tags: tags:
- latest - latest
- linux-amd64 - linux-amd64
@ -57,7 +63,6 @@ steps:
- refs/heads/dev - refs/heads/dev
event: event:
exclude: [pull_request, tag] exclude: [pull_request, tag]
trigger: trigger:
event: [push, pull_request, cron, tag] event: [push, pull_request, cron, tag]

@ -4,7 +4,6 @@ ignored:
- DL3039 - DL3039
# DL3041 warning: Specify version with `dnf install -y <package>-<version>`. # DL3041 warning: Specify version with `dnf install -y <package>-<version>`.
- DL3041 - DL3041
# SC2039 warning: In POSIX sh, brace expansion is undefined. # SC3009 warning: In POSIX sh, brace expansion is undefined.
# it actually still works # it actually still works
- SC2039 - SC3009

11
.pre-commit-config.yaml Normal file

@ -0,0 +1,11 @@
---
fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: check-merge-conflict
- repo: https://git.dotya.ml/wanderer/hadolint-pre-commit
rev: v0.0.1
hooks:
- id: hadolint-container

@ -1,19 +1,36 @@
# syntax=docker/dockerfile:1.2 # syntax=docker/dockerfile:1.3
FROM registry.fedoraproject.org/fedora:34 FROM registry.fedoraproject.org/fedora-minimal:36
ARG BUILD_DATE ARG BUILD_DATE
ARG VCS_REF ARG VCS_REF
LABEL description="Container image mainly used for CI testing of C/C++ programs on Fedora" # as per https://github.com/opencontainers/image-spec/blob/main/annotations.md,
# keep Label Schema labels for backward compatibility.
LABEL org.label-schema.build-date=$BUILD_DATE \ LABEL description="Container image mainly used for CI testing of C/C++ programs on Fedora" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.vcs-url="https://git.dotya.ml/wanderer/docker-fedora-cpp.git" \ org.label-schema.vcs-url="https://git.dotya.ml/wanderer/docker-fedora-cpp.git" \
org.label-schema.vcs-ref=$VCS_REF \ org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.license=GPL-3.0 org.label-schema.license=GPL-3.0 \
org.opencontainers.image.title="docker-fedora-cpp" \
org.opencontainers.image.description="Container image mainly used for CI testing of C/C++ programs on Fedora" \
org.opencontainers.image.created=$BUILD_DATE \
org.opencontainers.image.authors=wanderer \
org.opencontainers.image.url="https://git.dotya.ml/wanderer/docker-fedora-cpp.git" \
org.opencontainers.image.source="https://git.dotya.ml/wanderer/docker-fedora-cpp.git" \
org.opencontainers.image.revision=$VCS_REF \
org.opencontainers.image.licenses=GPL-3.0
RUN dnf --refresh upgrade -y \ RUN printf "[main]\ngpg_check=1\ninstallonly_limit=2\nclean_requirements_on_remove=True\nfastestmirror=True\nmax_parallel_downloads=7\n" > /etc/dnf/dnf.conf; \
&& dnf install -y \ cat /etc/dnf/dnf.conf; \
\
microdnf --refresh upgrade -y && \
\
\
microdnf install --nodocs dnf dnf-plugins-core -y && \
dnf copr enable eddsalkield/iwyu -y && \
microdnf install --nodocs --setopt install_weak_deps=0 -y \
git \ git \
ninja-build \
make \ make \
{c,auto}make \ {c,auto}make \
gcc \ gcc \
@ -21,7 +38,14 @@ RUN dnf --refresh upgrade -y \
libgcc \ libgcc \
libstdc++-{devel,static} \ libstdc++-{devel,static} \
glibc-devel \ glibc-devel \
iwyu \
cryptopp-devel \
libasan-static \
liblsan-static \
libubsan-static \
libtsan-static \
binutils \ binutils \
lld \
flex \ flex \
bison \ bison \
openmpi-devel \ openmpi-devel \
@ -43,21 +67,41 @@ RUN dnf --refresh upgrade -y \
pkgconf \ pkgconf \
kernel-devel \ kernel-devel \
ncurses-{c++-libs,devel,libs,static} \ ncurses-{c++-libs,devel,libs,static} \
&& dnf clean all -y numactl-{devel,libs} \
&& dnf copr disable eddsalkield/iwyu \
# see https://git.dotya.ml/wanderer/docker-fedora-cpp/issues/1 && rm -vf /etc/dnf/protected.d/dnf.conf \
# && microdnf remove dnf-plugins-core -y \
# building nDPI would fail with plain RUN and kaniko. && rpm --nodeps -e dnf \
# having it wrapped in 'bash -c' helped && microdnf clean all -y && \
RUN bash -c 'export MAKEFLAGS="$MAKEFLAGS -j$(nproc)" && printf "$MAKEFLAGS\n"; \ \
\
printf "/usr/local/lib\n" >> /etc/ld.so.conf.d/local.conf && \
/usr/sbin/ldconfig && \
\
\
bash -c 'export MAKEFLAGS="$MAKEFLAGS -j$(nproc)" && printf "$MAKEFLAGS\n"; \
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:$PATH"; \ export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:$PATH"; \
git clone https://github.com/ntop/nDPI.git /tmp/nDPI && \ git clone https://github.com/ntop/nDPI.git /tmp/nDPI && \
cd /tmp/nDPI ; \ cd /tmp/nDPI ; \
git checkout 1.7 && \ git checkout 1.7; \
./autogen.sh && \ ./autogen.sh && \
./configure && \ ./configure && \
make && \ make && \
make install' make install && \
RUN if [ -f /tmp/nDPI/config.log ]; then cat /tmp/nDPI/config.log; fi; \ make clean && \
git switch - ; \
./autogen.sh && \
./configure && \
make && \
make install'; \
\
if [ -f /tmp/nDPI/config.log ]; then cat /tmp/nDPI/config.log; fi; \
rm -rf /tmp/nDPI rm -rf /tmp/nDPI
# nDPI is by default (left unchanged) installed with prefix "/usr/local".
# we make sure the results (libs in /usr/local/lib) get picked up in subsequent
# linkings against it by aappending to /etc/ld.so.conf.d/local.conf.
# see https://git.dotya.ml/wanderer/docker-fedora-cpp/issues/1
#
# further, building nDPI would fail with plain RUN inside kaniko.
# having it wrapped in 'bash -c' helped

@ -4,18 +4,20 @@ dtag = immawanderer/fedora-cpp:testbuild
dargs = build -t $(dtag) --no-cache --pull - < $(dfile) dargs = build -t $(dtag) --no-cache --pull - < $(dfile)
cleanargs = image rm -f $(dtag) cleanargs = image rm -f $(dtag)
pruneargs = system prune -af pruneargs = system prune -af
dargskaniko = run --rm -it -w=$(kanikowdir) -v $$PWD:$(kanikowdir) dargskaniko = run --rm -it -w=$(kanikowdir) -v $$PWD:$(kanikowdir):z
kanikoexecutorimg = gcr.io/kaniko-project/executor:debug kanikoexecutorimg = gcr.io/kaniko-project/executor:v1.8.1-debug
kanikowdir = /src kanikowdir = /src
kanikocontext = . kanikocontext = .
kanikoargs = -f=$(dfile) -c=$(kanikocontext) --use-new-run --snapshotMode=redo --no-push --force kanikoargs = -f=$(dfile) -c=$(kanikocontext) --use-new-run --snapshotMode=redo --build-arg BUILD_DATE=$(build_date) --build-arg VCS_REF=$(vcs_ref) --no-push
hadolintimg = hadolint/hadolint:v1.23.0-8-gb01c5a9-alpine vcs_ref = $$(git rev-parse --short HEAD)
hadolintargs = run --rm -i -v $$PWD/.hadolint.yaml:/root/.config/hadolint.yaml build_date= $$(date -u +"%Y-%m-%dT%H:%M:%SZ")
hadolintimg = hadolint/hadolint
hadolinttag = v2.10.0-alpine
hadolintargs = run --rm -i -v $$PWD:/src:z --workdir=/src
.PHONY: hadolint build kaniko clean test prune .PHONY: hadolint build kaniko clean test prune
hadolint: hadolint:
$(dcmd) $(hadolintargs) $(hadolintimg) < $(dfile) $(dcmd) $(hadolintargs) $(hadolintimg):$(hadolinttag) < $(dfile)
kaniko: kaniko:
$(dcmd) $(dargskaniko) $(kanikoexecutorimg) $(kanikoargs) $(dcmd) $(dargskaniko) $(kanikoexecutorimg) $(kanikoargs)

@ -1,10 +1,10 @@
# docker-fedora-cpp # docker-fedora-cpp
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![Build Status](https://drone.dotya.ml/api/badges/wanderer/docker-fedora-cpp/status.svg?ref=refs/heads/dev)](https://drone.dotya.ml/wanderer/docker-fedora-cpp) [![Build Status](https://drone.dotya.ml/api/badges/wanderer/docker-fedora-cpp/status.svg?ref=refs/heads/dev)](https://drone.dotya.ml/wanderer/docker-fedora-cpp)
[![Docker Image Version (latest by date)](https://img.shields.io/docker/v/immawanderer/fedora-cpp)](https://hub.docker.com/r/immawanderer/fedora-cpp/tags/?page=1&ordering=last_updated) [![Docker Image Version (latest by date)](https://img.shields.io/docker/v/immawanderer/fedora-cpp)](https://hub.docker.com/r/immawanderer/fedora-cpp/tags/?page=1&ordering=last_updated)
[![Docker Image Version (tag latest semver)](https://img.shields.io/docker/v/immawanderer/archlinux/linux-amd64)](https://hub.docker.com/r/immawanderer/fedora-cpp/tags/?page=1&ordering=last_updated&name=linux-amd64) [![Docker Image Version (tag latest semver)](https://img.shields.io/docker/v/immawanderer/archlinux/linux-amd64)](https://hub.docker.com/r/immawanderer/fedora-cpp/tags/?page=1&ordering=last_updated&name=linux-amd64)
[![Docker Image Size (tag)](https://img.shields.io/docker/image-size/immawanderer/archlinux/linux-amd64)](https://hub.docker.com/r/immawanderer/fedora-cpp/tags/?page=1&ordering=last_updated&name=linux-amd64) [![Docker Image Size (tag)](https://img.shields.io/docker/image-size/immawanderer/archlinux/linux-amd64)](https://hub.docker.com/r/immawanderer/fedora-cpp/tags/?page=1&ordering=last_updated&name=linux-amd64)
[![MicroBadger Layers (tag)](https://img.shields.io/microbadger/layers/immawanderer/archlinux/linux-amd64)](https://hub.docker.com/r/immawanderer/fedora-cpp/tags/?page=1&ordering=last_updated&name=linux-amd64)
[![Docker pulls](https://img.shields.io/docker/pulls/immawanderer/archlinux)](https://hub.docker.com/r/immawanderer/fedora-cpp/) [![Docker pulls](https://img.shields.io/docker/pulls/immawanderer/archlinux)](https://hub.docker.com/r/immawanderer/fedora-cpp/)
This repository provides a Dockerfile to create a container image mainly used for CI testing of C/C++ programs on Fedora. This repository provides a Dockerfile to create a container image mainly used for CI testing of C/C++ programs on Fedora.
@ -14,11 +14,14 @@ The image is rebuilt nightly to ensure it always has the latest packages.
development happens on [this Gitea instance](https://git.dotya.ml/wanderer/docker-fedora-cpp) development happens on [this Gitea instance](https://git.dotya.ml/wanderer/docker-fedora-cpp)
## What you get ## What you get
* updated `registry.fedoraproject.org/fedora:34` image * updated `registry.fedoraproject.org/fedora-minimal:36` image
* the result of * the result of
```sh ```sh
dnf install -y \ microdnf install --nodocs dnf dnf-plugins-core -y && \
dnf copr enable eddsalkield/iwyu -y && \
microdnf install --nodocs --setopt install_weak_deps=0 -y \
git \ git \
ninja-build \
make \ make \
{c,auto}make \ {c,auto}make \
gcc \ gcc \
@ -26,7 +29,14 @@ development happens on [this Gitea instance](https://git.dotya.ml/wanderer/docke
libgcc \ libgcc \
libstdc++-{devel,static} \ libstdc++-{devel,static} \
glibc-devel \ glibc-devel \
iwyu \
cryptopp-devel \
libasan-static \
liblsan-static \
libubsan-static \
libtsan-static \
binutils \ binutils \
lld \
flex \ flex \
bison \ bison \
openmpi-devel \ openmpi-devel \
@ -48,7 +58,12 @@ development happens on [this Gitea instance](https://git.dotya.ml/wanderer/docke
pkgconf \ pkgconf \
kernel-devel \ kernel-devel \
ncurses-{c++-libs,devel,libs,static} \ ncurses-{c++-libs,devel,libs,static} \
&& dnf clean all -y numactl-{devel,libs} \
&& dnf copr disable eddsalkield/iwyu \
&& rm -vf /etc/dnf/protected.d/dnf.conf \
&& microdnf remove dnf-plugins-core -y \
&& rpm --nodeps -e dnf \
&& microdnf clean all -y
``` ```
* compiled [`github.com/ntop/nDPI.git`](https://github.com/ntop/nDPI) * compiled [`github.com/ntop/nDPI.git`](https://github.com/ntop/nDPI)