|
| 1 | +# SPDX-License-Identifier: BSD-3-Clause |
| 2 | +# Copyright 2016-2021, Intel Corporation |
| 3 | + |
| 4 | +# |
| 5 | +# Dockerfile - a 'recipe' for Docker to build an image of almalinux-based |
| 6 | +# environment prepared for running libpmemobj-cpp tests. |
| 7 | +# |
| 8 | + |
| 9 | +# Pull base image |
| 10 | +FROM registry.hub.docker.com/library/almalinux:8 |
| 11 | + |
| 12 | + |
| 13 | +# Set required environment variables |
| 14 | +ENV OS almalinux |
| 15 | +ENV OS_VER 8 |
| 16 | +ENV PACKAGE_MANAGER rpm |
| 17 | +ENV NOTTY 1 |
| 18 | + |
| 19 | +# Additional parameters to build docker without building components |
| 20 | +ARG SKIP_VALGRIND_BUILD |
| 21 | +ARG SKIP_PMDK_BUILD |
| 22 | + |
| 23 | +# Base development packages |
| 24 | +ARG BASE_DEPS="\ |
| 25 | + cmake \ |
| 26 | + gcc \ |
| 27 | + gcc-c++ \ |
| 28 | + git \ |
| 29 | + make" |
| 30 | + |
| 31 | +# Dependencies for compiling libpmemobj-cpp project |
| 32 | +ARG LIBPMEMOBJ_CPP_DEPS="\ |
| 33 | + libatomic \ |
| 34 | + tbb-devel" |
| 35 | + |
| 36 | +# PMDK's dependencies (optional; libpmemobj-devel package may be used instead) |
| 37 | +ARG PMDK_DEPS="\ |
| 38 | + autoconf \ |
| 39 | + automake \ |
| 40 | + daxctl-devel \ |
| 41 | + gdb \ |
| 42 | + man \ |
| 43 | + ndctl-devel \ |
| 44 | + pandoc \ |
| 45 | + python3 \ |
| 46 | + rpm-build \ |
| 47 | + rpm-build-libs \ |
| 48 | + rpmdevtools \ |
| 49 | + which" |
| 50 | + |
| 51 | +# pmem's Valgrind dependencies (optional; valgrind-devel package may be used instead) |
| 52 | +ARG VALGRIND_DEPS="\ |
| 53 | + autoconf \ |
| 54 | + automake" |
| 55 | + |
| 56 | +# Examples (optional) |
| 57 | +ARG EXAMPLES_DEPS="\ |
| 58 | + ncurses-devel" |
| 59 | + |
| 60 | +# Documentation (optional) |
| 61 | +ARG DOC_DEPS="\ |
| 62 | + doxygen" |
| 63 | + |
| 64 | +# Tests (optional) |
| 65 | +# NOTE: glibc is installed as a separate command; see below |
| 66 | +ARG TESTS_DEPS="\ |
| 67 | + gdb \ |
| 68 | + libunwind-devel" |
| 69 | + |
| 70 | +# Misc for our builds/CI (optional) |
| 71 | +ARG MISC_DEPS="\ |
| 72 | + clang \ |
| 73 | + passwd \ |
| 74 | + perl-Text-Diff \ |
| 75 | + pkgconf \ |
| 76 | + sudo" |
| 77 | + |
| 78 | +# Update package repository, extend dnf's package base and install basic tools |
| 79 | +RUN dnf update -y \ |
| 80 | + && dnf install -y epel-release \ |
| 81 | + && dnf install -y 'dnf-command(config-manager)' \ |
| 82 | + && dnf config-manager --set-enabled powertools \ |
| 83 | + && dnf update -y \ |
| 84 | + && dnf install -y --nobest \ |
| 85 | + ${BASE_DEPS} \ |
| 86 | + ${LIBPMEMOBJ_CPP_DEPS} \ |
| 87 | + ${PMDK_DEPS} \ |
| 88 | + ${VALGRIND_DEPS} \ |
| 89 | + ${EXAMPLES_DEPS} \ |
| 90 | + ${DOC_DEPS} \ |
| 91 | + ${TESTS_DEPS} \ |
| 92 | + ${MISC_DEPS} \ |
| 93 | + && dnf debuginfo-install -y glibc \ |
| 94 | + && dnf clean all |
| 95 | + |
| 96 | +# Install valgrind |
| 97 | +COPY install-valgrind.sh install-valgrind.sh |
| 98 | +RUN ./install-valgrind.sh |
| 99 | + |
| 100 | +# Install pmdk |
| 101 | +COPY install-pmdk.sh install-pmdk.sh |
| 102 | +RUN ./install-pmdk.sh rpm |
| 103 | + |
| 104 | +# Add user |
| 105 | +ENV USER user |
| 106 | +ENV USERPASS pass |
| 107 | +RUN useradd -m $USER \ |
| 108 | + && echo $USERPASS | passwd $USER --stdin \ |
| 109 | + && gpasswd wheel -a $USER |
| 110 | +USER $USER |
0 commit comments