|
| 1 | +# Copyright (C) 2023-2024 Intel Corporation |
| 2 | +# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions. |
| 3 | +# See LICENSE.TXT |
| 4 | +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 5 | + |
| 6 | +# |
| 7 | +# Dockerfile - a 'recipe' for Docker to build an image of opensuse-leap-based |
| 8 | +# environment for building the Unified Runtime project. |
| 9 | +# |
| 10 | + |
| 11 | +# Pull base image ("15") |
| 12 | +FROM registry.hub.docker.com/opensuse/leap@sha256:1cf79e78bb69f39fb2f78a7c2c7ebc4b64cf8d82eb1df76cd36767a595ada7a8 |
| 13 | + |
| 14 | +# Set environment variables |
| 15 | +ENV OS opensuse-leap |
| 16 | +ENV OS_VER 15 |
| 17 | +ENV NOTTY 1 |
| 18 | + |
| 19 | +# Additional parameters to build docker without building components. |
| 20 | +# These ARGs can be set in docker building phase and are used |
| 21 | +# within bash scripts (executed within docker). |
| 22 | +ARG SKIP_DPCPP_BUILD |
| 23 | +ARG SKIP_LIBBACKTRACE_BUILD |
| 24 | + |
| 25 | +# Base development packages |
| 26 | +ARG BASE_DEPS="\ |
| 27 | + cmake \ |
| 28 | + gcc \ |
| 29 | + gcc-c++ \ |
| 30 | + git \ |
| 31 | + glibc-devel \ |
| 32 | + libstdc++-devel \ |
| 33 | + make" |
| 34 | + |
| 35 | +# Unified Runtime's dependencies |
| 36 | +ARG UR_DEPS="\ |
| 37 | + doxygen \ |
| 38 | + python3 \ |
| 39 | + python3-devel \ |
| 40 | + python3-pip" |
| 41 | + |
| 42 | +# Miscellaneous for our builds/CI (optional) |
| 43 | +ARG MISC_DEPS="\ |
| 44 | + clang \ |
| 45 | + gzip \ |
| 46 | + libncurses5 \ |
| 47 | + sudo \ |
| 48 | + tar \ |
| 49 | + wget" |
| 50 | + |
| 51 | +# add openSUSE Leap 15.5 Oss repo |
| 52 | +RUN zypper ar -f https://download.opensuse.org/distribution/leap/15.5/repo/oss/ oss |
| 53 | + |
| 54 | +# Update and install required packages |
| 55 | +RUN zypper update -y \ |
| 56 | + && zypper install -y \ |
| 57 | + ${BASE_DEPS} \ |
| 58 | + ${UR_DEPS} \ |
| 59 | + ${MISC_DEPS} \ |
| 60 | + && zypper clean all |
| 61 | + |
| 62 | +# Prepare a dir (accessible by anyone) |
| 63 | +RUN mkdir --mode 777 /opt/ur/ |
| 64 | + |
| 65 | +# Additional dev. dependencies (installed via pip) |
| 66 | +# |
| 67 | +# It's actively used and tested only on selected distros. Be aware |
| 68 | +# they may not work, because pip packages list differ from OS to OS. |
| 69 | +COPY third_party/requirements.txt /opt/ur/requirements.txt |
| 70 | + |
| 71 | +# Install DPC++ |
| 72 | +COPY .github/docker/install_dpcpp.sh /opt/ur/install_dpcpp.sh |
| 73 | +ENV DPCPP_PATH=/opt/dpcpp |
| 74 | +RUN /opt/ur/install_dpcpp.sh |
| 75 | + |
| 76 | +# Install libbacktrace |
| 77 | +COPY .github/docker/install_libbacktrace.sh /opt/ur/install_libbacktrace.sh |
| 78 | +RUN /opt/ur/install_libbacktrace.sh |
| 79 | + |
| 80 | +# Add a new (non-root) 'test_user' and switch to it |
| 81 | +ENV USER test_user |
| 82 | +ENV USERPASS pass |
| 83 | +ENV PFILE ./password |
| 84 | +RUN useradd -m ${USER} \ |
| 85 | + && echo ${USERPASS} > ${PFILE} \ |
| 86 | + && echo ${USERPASS} >> ${PFILE} \ |
| 87 | + && passwd ${USER} < ${PFILE} \ |
| 88 | + && rm -f ${PFILE} \ |
| 89 | + && sed -i 's/# %wheel/%wheel/g' /etc/sudoers \ |
| 90 | + && groupadd wheel \ |
| 91 | + && gpasswd wheel -a ${USER} |
| 92 | +USER test_user |
0 commit comments