| 1 |
# SPDX-License-Identifier: BSD-3-Clause |
| 2 |
# Copyright 2016-2023, Intel Corporation |
| 3 |
|
| 4 |
# |
| 5 |
# Dockerfile - a 'recipe' for Docker to build an image of fedora-based |
| 6 |
# environment for building the PMDK project. |
| 7 |
# |
| 8 |
|
| 9 |
# Pull base image |
| 10 |
FROM fedora:37 |
| 11 |
MAINTAINER [email protected] |
| 12 |
|
| 13 |
# Set required environment variables |
| 14 |
ENV OS fedora |
| 15 |
ENV OS_VER 37 |
| 16 |
ENV PACKAGE_MANAGER rpm |
| 17 |
ENV NOTTY 1 |
| 18 |
|
| 19 |
# PMDK basic dependencies |
| 20 |
ENV BASE_DEPS "\ |
| 21 |
cmake \ |
| 22 |
git \ |
| 23 |
daxctl-devel \ |
| 24 |
make \ |
| 25 |
ndctl-devel \ |
| 26 |
pkgconfig" |
| 27 |
|
| 28 |
# Valgrind dependencies |
| 29 |
ENV VALGRIND_DEPS "\ |
| 30 |
autoconf \ |
| 31 |
automake \ |
| 32 |
file \ |
| 33 |
findutils \ |
| 34 |
git" |
| 35 |
|
| 36 |
# benchmarks dependencies (optional) |
| 37 |
ENV BENCH_DEPS "\ |
| 38 |
glib2-devel" |
| 39 |
|
| 40 |
# examples dependencies (optional) |
| 41 |
ENV EXAMPLES_DEPS "\ |
| 42 |
fuse \ |
| 43 |
fuse-devel \ |
| 44 |
ncurses-devel \ |
| 45 |
libuv-devel" |
| 46 |
|
| 47 |
# documentation dependencies (optional) |
| 48 |
ENV DOC_DEPS "\ |
| 49 |
pandoc" |
| 50 |
|
| 51 |
# tests dependencies |
| 52 |
ENV TESTS_DEPS "\ |
| 53 |
bc \ |
| 54 |
gdb \ |
| 55 |
libunwind-devel \ |
| 56 |
ndctl \ |
| 57 |
openssh-server \ |
| 58 |
python3 \ |
| 59 |
strace" |
| 60 |
|
| 61 |
# packaging dependencies |
| 62 |
ENV PACKAGING_DEPS "\ |
| 63 |
rpm-build \ |
| 64 |
rpm-build-libs \ |
| 65 |
rpmdevtools" |
| 66 |
|
| 67 |
# miscellaneous dependencies (mostly for CI) |
| 68 |
ENV MISC_DEPS "\ |
| 69 |
clang \ |
| 70 |
hub \ |
| 71 |
lbzip2 \ |
| 72 |
man \ |
| 73 |
python3-flake8 \ |
| 74 |
python3-pip \ |
| 75 |
rsync \ |
| 76 |
shadow-utils \ |
| 77 |
sudo \ |
| 78 |
tar \ |
| 79 |
which \ |
| 80 |
xmlto" |
| 81 |
|
| 82 |
# python scripts dependencies |
| 83 |
ENV PYTHON_DEPS "\ |
| 84 |
distro \ |
| 85 |
xmlrunner" |
| 86 |
|
| 87 |
# Copy install valgrind script |
| 88 |
COPY install-valgrind.sh install-valgrind.sh |
| 89 |
|
| 90 |
RUN dnf update -y && dnf install -y \ |
| 91 |
$BASE_DEPS \ |
| 92 |
$VALGRIND_DEPS \ |
| 93 |
$BENCH_DEPS \ |
| 94 |
$EXAMPLES_DEPS \ |
| 95 |
$DOC_DEPS \ |
| 96 |
$TESTS_DEPS \ |
| 97 |
$PACKAGING_DEPS \ |
| 98 |
$MISC_DEPS \ |
| 99 |
&& ./install-valgrind.sh fedora \ |
| 100 |
&& dnf clean all |
| 101 |
|
| 102 |
RUN pip3 install $PYTHON_DEPS |
| 103 |
|
| 104 |
# Add and switch user |
| 105 |
ENV USER pmdkuser |
| 106 |
ENV USERPASS pmdkpass |
| 107 |
RUN useradd -m $USER |
| 108 |
RUN echo "$USER:$USERPASS" | chpasswd |
| 109 |
RUN gpasswd wheel -a $USER |
| 110 |
RUN echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers |
| 111 |
USER $USER |