Compare commits
31 Commits
Author | SHA1 | Date | |
---|---|---|---|
489a1d3404 | |||
ea93c12d9e | |||
f1754e6e32 | |||
1760f6e6cf | |||
e61c76b1a8 | |||
8e7d186259 | |||
7516b21702 | |||
d1518f11b7 | |||
3bb4950e8e | |||
edc88ff5e4 | |||
5337a03c11 | |||
a841268fa5 | |||
1fa322a2c9 | |||
9e0d34a88f | |||
8bcea33137 | |||
3eaed7cdae | |||
91636b4219 | |||
4bd15e92c8 | |||
ea744cebe5 | |||
ce9dc1e158 | |||
4d3312564e | |||
8fc21d6fde | |||
c42387d7ee | |||
b2ee470ff1 | |||
434e69e83e | |||
892564909c | |||
bdfd8af631 | |||
b7679ef08e | |||
c7de2a834c | |||
8ef5fc9686 | |||
81860b9567 |
@ -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
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
|
80
Dockerfile
80
Dockerfile
@ -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
|
||||||
|
16
Makefile
16
Makefile
@ -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)
|
||||||
|
23
README.md
23
README.md
@ -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)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user