Skip to content

Commit 069158c

Browse files
author
Claudio André
committed
CI: import all Dockerfiles used for CI/CD
It's not the simplest choice, but it makes the code infrastructure more complete and self-contained. Signed-off-by: Claudio André <[email protected]>
1 parent 6df4dfc commit 069158c

10 files changed

+400
-1
lines changed

.github/actions/spelling/expect.txt

+10-1
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ ansible
1111
apk
1212
apps
1313
appveyor
14-
archs
1514
asan
1615
ASLR
1716
ath
1817
avx
1918
awor
2019
aws
20+
basekit
2121
bestpractices
2222
bugtracker
2323
BUILDID
@@ -55,16 +55,19 @@ cyggmp
5555
cyggomp
5656
cygz
5757
davidanson
58+
debhelper
5859
devcontainer
5960
distro
6061
dmg
6162
dnf
6263
dns
64+
Dockerfiles
6365
drwx
6466
drwxr
6567
drwxrwxr
6668
dynamicbase
6769
editorconfig
70+
elfutils
6871
endfor
6972
esbenp
7073
exe
@@ -108,16 +111,20 @@ LASTEXITCODE
108111
Lauchpad
109112
LDFLAGS
110113
len
114+
libasan
111115
libbz
112116
libcrypt
113117
libexec
114118
libfuzzer
115119
libgmp
116120
libgomp
121+
libnet
117122
libomp
118123
libopencl
119124
libpcap
120125
libpocl
126+
libtsan
127+
libubsan
121128
libusb
122129
lsb
123130
LWS
@@ -135,6 +142,7 @@ OBJS
135142
ocl
136143
oidc
137144
omp
145+
oneapi
138146
openmp
139147
oss
140148
osv
@@ -154,6 +162,7 @@ Randomisation
154162
rar
155163
RCracker
156164
realpath
165+
redhat
157166
redistributors
158167
rekor
159168
rsa

.github/dependabot.yml

+5
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,8 @@ updates:
3030
directory: /.clusterfuzzlite
3131
schedule:
3232
interval: daily
33+
34+
- package-ecosystem: docker
35+
directory: /CI/Dockerfiles
36+
schedule:
37+
interval: daily

.github/workflows/build_CI.yml

+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
###############################################################################
2+
# _ _ _ _ _____ _
3+
# | | | | | | | | | __ \(_)
4+
# | | ___ | |__ _ __ | |_| |__ ___ | |__) |_ _ __ _ __ ___ _ __
5+
# _ | |/ _ \| '_ \| '_ \ | __| '_ \ / _ \ | _ /| | '_ \| '_ \ / _ \ '__|
6+
# | |__| | (_) | | | | | | | | |_| | | | __/ | | \ \| | |_) | |_) | __/ |
7+
# \____/ \___/|_| |_|_| |_| \__|_| |_|\___| |_| \_\_| .__/| .__/ \___|_|
8+
# | | | |
9+
# |_| |_|
10+
#
11+
# Copyright (c) 2024 Claudio André <[email protected]>
12+
#
13+
# This program comes with ABSOLUTELY NO WARRANTY; express or implied.
14+
#
15+
# This program is free software: you can redistribute it and/or modify
16+
# it under the terms of the GNU General Public License as published by
17+
# the Free Software Foundation, as expressed in version 2, seen at
18+
# http://www.gnu.org/licenses/gpl-2.0.html
19+
###############################################################################
20+
21+
---
22+
name: CI Docker image
23+
24+
"on":
25+
push:
26+
branches: [images]
27+
workflow_dispatch:
28+
29+
env:
30+
REPO: ghcr.io/${{ github.repository_owner }}/john-ci
31+
32+
permissions: read-all
33+
jobs:
34+
build:
35+
name: Build image
36+
runs-on: ubuntu-latest
37+
continue-on-error: true
38+
39+
strategy:
40+
matrix:
41+
include:
42+
- image-tag: fedora.latest
43+
dockerfile: Dockerfile.FedoraLatest
44+
- image-tag: fedora.flatpak
45+
dockerfile: Dockerfile.flatpak.package
46+
- image-tag: ubuntu.opencl
47+
dockerfile: Dockerfile.OpenCL
48+
- image-tag: ubuntu.devel
49+
dockerfile: Dockerfile.UbuntuDevel
50+
- image-tag: ubuntu.rolling
51+
dockerfile: Dockerfile.UbuntuRolling
52+
- image-tag: redhat.ubi8
53+
dockerfile: Dockerfile.RHUbi8
54+
55+
permissions:
56+
packages: write
57+
contents: read
58+
59+
outputs:
60+
image: ${{ steps.image.outputs.image }}
61+
digest: ${{ steps.build-and-push.outputs.digest }}
62+
63+
steps:
64+
- name: Check out the repo
65+
uses: actions/checkout@v4
66+
67+
- name: Log in to GitHub Docker Registry
68+
uses: docker/login-action@v3
69+
with:
70+
registry: ghcr.io
71+
username: ${{ github.repository_owner }}
72+
password: ${{ secrets.GITHUB_TOKEN }}
73+
74+
- name: Build container image
75+
id: build-and-push
76+
uses: docker/build-push-action@v5
77+
with:
78+
push: true
79+
file: "${{ github.workspace }}/CI/Dockerfiles/${{ matrix.dockerfile }}"
80+
tags: |
81+
${{ env.REPO }}:${{ matrix.image-tag }}
82+
${{ env.REPO }}:${{ matrix.image-tag }}J${{ github.run_number }}
83+
outputs: "type=image,name=target,\
84+
annotation-index.org.opencontainers.image.authors=Claudio André <[email protected]>,\
85+
annotation-index.org.opencontainers.image.description=John the Ripper CI"
86+
87+
- name: Output image
88+
id: image
89+
run: |
90+
image_name="${{ env.REPO }}:${{ matrix.image-tag }}"
91+
echo "The image is $image_name"
92+
echo "image=$image_name" >> "$GITHUB_OUTPUT"
93+
94+
# It's unclear whether provenance can work with a matrix of Docker images
95+
provenance:
96+
if: ${{ false }}
97+
needs: [build]
98+
permissions:
99+
actions: read # for detecting the GitHub Actions environment.
100+
id-token: write # for creating OIDC tokens for signing.
101+
packages: write # for uploading attestations.
102+
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
103+
with:
104+
image: ${{ needs.build.outputs.image }}
105+
digest: ${{ needs.build.outputs.digest }}
106+
registry-username: ${{ github.actor }}
107+
secrets:
108+
registry-password: ${{ secrets.GITHUB_TOKEN }}
+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
###############################################################################
2+
# _ _ _ _ _____ _
3+
# | | | | | | | | | __ \(_)
4+
# | | ___ | |__ _ __ | |_| |__ ___ | |__) |_ _ __ _ __ ___ _ __
5+
# _ | |/ _ \| '_ \| '_ \ | __| '_ \ / _ \ | _ /| | '_ \| '_ \ / _ \ '__|
6+
# | |__| | (_) | | | | | | | | |_| | | | __/ | | \ \| | |_) | |_) | __/ |
7+
# \____/ \___/|_| |_|_| |_| \__|_| |_|\___| |_| \_\_| .__/| .__/ \___|_|
8+
# | | | |
9+
# |_| |_|
10+
#
11+
# Copyright (c) 2017-2024 Claudio André <[email protected]>
12+
#
13+
# This program comes with ABSOLUTELY NO WARRANTY; express or implied.
14+
#
15+
# This program is free software: you can redistribute it and/or modify
16+
# it under the terms of the GNU General Public License as published by
17+
# the Free Software Foundation, as expressed in version 2, seen at
18+
# http://www.gnu.org/licenses/gpl-2.0.html
19+
###############################################################################
20+
# Dockerfile for Continuous Integration
21+
# More info at https://github.com/openwall/john-packages
22+
23+
FROM fedora:latest
24+
LABEL org.opencontainers.image.authors="Claudio André <[email protected]>"
25+
LABEL description="Docker images for John the Ripper CI (1.0.Fedora Latest)"
26+
27+
RUN dnf -y -q update \
28+
&& dnf -y install \
29+
@development-tools openssl-devel gmp-devel libpcap-devel bzip2-devel wget \
30+
clang libasan libubsan libtsan american-fuzzy-lop zzuf pocl-devel \
31+
american-fuzzy-lop-clang \
32+
&& useradd -U -m JtR
33+
34+
USER JtR
35+
ENV BASE fedora
36+
CMD /bin/bash

CI/Dockerfiles/Dockerfile.OpenCL

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
###############################################################################
2+
# _ _ _ _ _____ _
3+
# | | | | | | | | | __ \(_)
4+
# | | ___ | |__ _ __ | |_| |__ ___ | |__) |_ _ __ _ __ ___ _ __
5+
# _ | |/ _ \| '_ \| '_ \ | __| '_ \ / _ \ | _ /| | '_ \| '_ \ / _ \ '__|
6+
# | |__| | (_) | | | | | | | | |_| | | | __/ | | \ \| | |_) | |_) | __/ |
7+
# \____/ \___/|_| |_|_| |_| \__|_| |_|\___| |_| \_\_| .__/| .__/ \___|_|
8+
# | | | |
9+
# |_| |_|
10+
#
11+
# Copyright (c) 2017-2024 Claudio André <[email protected]>
12+
#
13+
# This program comes with ABSOLUTELY NO WARRANTY; express or implied.
14+
#
15+
# This program is free software: you can redistribute it and/or modify
16+
# it under the terms of the GNU General Public License as published by
17+
# the Free Software Foundation, as expressed in version 2, seen at
18+
# http://www.gnu.org/licenses/gpl-2.0.html
19+
###############################################################################
20+
# Dockerfile for Continuous Integration
21+
# More info at https://github.com/openwall/john-packages
22+
23+
FROM ubuntu:24.04
24+
LABEL org.opencontainers.image.authors="Claudio André <[email protected]>"
25+
LABEL description="Docker images for John the Ripper CI (1.0.Ubuntu 24 OpenCL)"
26+
27+
RUN apt-get update -qq \
28+
&& export DEBIAN_FRONTEND="noninteractive" \
29+
&& apt-get install -y \
30+
build-essential libssl-dev yasm libgmp-dev libpcap-dev pkg-config debhelper libnet1-dev \
31+
libbz2-dev wget llvm libomp-dev zlib1g-dev git clang afl zzuf \
32+
libpocl-dev ocl-icd-opencl-dev ocl-icd-libopencl1 pocl-opencl-icd opencl-headers \
33+
&& useradd -U -m JtR \
34+
# ==================================================================
35+
# Clean up the image (shrink the Docker image)
36+
# ------------------------------------------------------------------
37+
&& apt-get -y clean \
38+
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
39+
40+
# USER JtR => it is much better to use root on Travis
41+
ENV BASE ubuntu
42+
CMD /bin/bash
+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
###############################################################################
2+
# _ _ _ _ _____ _
3+
# | | | | | | | | | __ \(_)
4+
# | | ___ | |__ _ __ | |_| |__ ___ | |__) |_ _ __ _ __ ___ _ __
5+
# _ | |/ _ \| '_ \| '_ \ | __| '_ \ / _ \ | _ /| | '_ \| '_ \ / _ \ '__|
6+
# | |__| | (_) | | | | | | | | |_| | | | __/ | | \ \| | |_) | |_) | __/ |
7+
# \____/ \___/|_| |_|_| |_| \__|_| |_|\___| |_| \_\_| .__/| .__/ \___|_|
8+
# | | | |
9+
# |_| |_|
10+
#
11+
# Copyright (c) 2023-2024 Claudio André <[email protected]>
12+
#
13+
# This program comes with ABSOLUTELY NO WARRANTY; express or implied.
14+
#
15+
# This program is free software: you can redistribute it and/or modify
16+
# it under the terms of the GNU General Public License as published by
17+
# the Free Software Foundation, as expressed in version 2, seen at
18+
# http://www.gnu.org/licenses/gpl-2.0.html
19+
###############################################################################
20+
# Dockerfile for Continuous Integration
21+
# More info at https://github.com/openwall/john-packages
22+
23+
FROM ubuntu:22.04
24+
LABEL org.opencontainers.image.authors="Claudio André <[email protected]>"
25+
LABEL description="Docker images for John the Ripper CI (1.0.Ubuntu 22 Intel OpenCL)"
26+
27+
# DO NOT update this automatically. OpenCL drivers are fragile and must be maintained very carefully.
28+
# RUN apt-get update -qq \
29+
# && apt-get install -y \
30+
# build-essential libssl-dev zlib1g-dev yasm libgmp-dev libpcap-dev \
31+
# pkg-config libbz2-dev wget \
32+
# ocl-icd-opencl-dev clinfo git \
33+
# && wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
34+
# | gpg --dearmor | tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null \
35+
# && echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" \
36+
# | tee /etc/apt/sources.list.d/oneAPI.list \
37+
# && apt-get update -qq \
38+
# && apt-get install -y \
39+
# intel-oneapi-runtime-opencl intel-basekit \
40+
# && useradd -U -m JtR \
41+
# && apt-get -y clean \
42+
# && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
43+
44+
# Workaround for an issue in Intel libraries installation script
45+
ENV LD_LIBRARY_PATH=/opt/intel/oneapi/2024.0/lib/:"$LD_LIBRARY_PATH"
46+
ENV BASE ubuntu
47+
CMD /bin/bash

CI/Dockerfiles/Dockerfile.RHUbi8

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
###############################################################################
2+
# _ _ _ _ _____ _
3+
# | | | | | | | | | __ \(_)
4+
# | | ___ | |__ _ __ | |_| |__ ___ | |__) |_ _ __ _ __ ___ _ __
5+
# _ | |/ _ \| '_ \| '_ \ | __| '_ \ / _ \ | _ /| | '_ \| '_ \ / _ \ '__|
6+
# | |__| | (_) | | | | | | | | |_| | | | __/ | | \ \| | |_) | |_) | __/ |
7+
# \____/ \___/|_| |_|_| |_| \__|_| |_|\___| |_| \_\_| .__/| .__/ \___|_|
8+
# | | | |
9+
# |_| |_|
10+
#
11+
# Copyright (c) 2024 Claudio André <[email protected]>
12+
#
13+
# This program comes with ABSOLUTELY NO WARRANTY; express or implied.
14+
#
15+
# This program is free software: you can redistribute it and/or modify
16+
# it under the terms of the GNU General Public License as published by
17+
# the Free Software Foundation, as expressed in version 2, seen at
18+
# http://www.gnu.org/licenses/gpl-2.0.html
19+
###############################################################################
20+
# Dockerfile for Continuous Integration
21+
# More info at https://github.com/openwall/john-packages
22+
23+
FROM registry.access.redhat.com/ubi8/ubi
24+
LABEL org.opencontainers.image.authors="Claudio André <[email protected]>"
25+
LABEL description="Docker images for John the Ripper CI (1.0.Red Hat 8)"
26+
27+
RUN yum -y -q update \
28+
&& yum -y install \
29+
openssl-devel gmp-devel libpcap-devel bzip2-devel wget gcc git perl \
30+
&& useradd -U -m JtR
31+
32+
ENV BASE RedHat-UBI
33+
CMD /bin/bash

CI/Dockerfiles/Dockerfile.UbuntuDevel

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
###############################################################################
2+
# _ _ _ _ _____ _
3+
# | | | | | | | | | __ \(_)
4+
# | | ___ | |__ _ __ | |_| |__ ___ | |__) |_ _ __ _ __ ___ _ __
5+
# _ | |/ _ \| '_ \| '_ \ | __| '_ \ / _ \ | _ /| | '_ \| '_ \ / _ \ '__|
6+
# | |__| | (_) | | | | | | | | |_| | | | __/ | | \ \| | |_) | |_) | __/ |
7+
# \____/ \___/|_| |_|_| |_| \__|_| |_|\___| |_| \_\_| .__/| .__/ \___|_|
8+
# | | | |
9+
# |_| |_|
10+
#
11+
# Copyright (c) 2017-2024 Claudio André <[email protected]>
12+
#
13+
# This program comes with ABSOLUTELY NO WARRANTY; express or implied.
14+
#
15+
# This program is free software: you can redistribute it and/or modify
16+
# it under the terms of the GNU General Public License as published by
17+
# the Free Software Foundation, as expressed in version 2, seen at
18+
# http://www.gnu.org/licenses/gpl-2.0.html
19+
###############################################################################
20+
# Dockerfile for Continuous Integration
21+
# More info at https://github.com/openwall/john-packages
22+
23+
FROM ubuntu:devel
24+
LABEL org.opencontainers.image.authors="Claudio André <[email protected]>"
25+
LABEL description="Docker images for John the Ripper CI (1.0.Ubuntu Devel)"
26+
27+
RUN apt-get update -qq \
28+
&& export DEBIAN_FRONTEND="noninteractive" \
29+
&& apt-get install -y \
30+
build-essential libssl-dev yasm libgmp-dev libpcap-dev pkg-config debhelper libnet1-dev \
31+
libbz2-dev wget llvm libomp-dev zlib1g-dev git clang \
32+
&& useradd -U -m JtR \
33+
# ==================================================================
34+
# Clean up the image (shrink the Docker image)
35+
# ------------------------------------------------------------------
36+
&& apt-get -y clean \
37+
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
38+
39+
# USER JtR => it is much better to use root on Travis
40+
ENV BASE ubuntu
41+
CMD /bin/bash

0 commit comments

Comments
 (0)