GithubHelp home page GithubHelp logo

isabella232 / onecontainer-templates Goto Github PK

View Code? Open in Web Editor NEW

This project forked from intel/onecontainer-templates

0.0 0.0 0.0 59 KB

License: BSD 3-Clause "New" or "Revised" License

Shell 1.82% CMake 15.67% M4 82.51%

onecontainer-templates's Introduction

M4 Docker Templates

Overview

This project contains collection of component build & install m4 templates which can be used as ingredients of docker images. You will find template definitions for key Intel software and popular frameworks. For example:

Supported base images

Project supports the following base images:

OS image Support level
ubuntu:20.04 Full
ubuntu:18.04 Experimental
centos:8 Experimental
centos:7 Experimental

Mind that not all of the component templates might be supported for particular OS image. Currently all templates are supported for ubuntu:20.04 image. List of supported templates for base images with experimental support level might not be defined.

Build and install

Project uses cmake (version 2.8 or higher) to build and install. Configure and install as follows:

PREFIX=/usr/local
cmake -DCMAKE_INSTALL_PREFIX=$PREFIX .
make -j$(nproc)
make install

You will get template files installed relative to:

$PREFIX/share/m4docker-<major.minor>

Make sure to add include paths to template locations to be able to use them in a top-level Dockerfile.m4 template:

m4docker=$(find $PREFIX -type d -name m4docker-*.*)
m4 -I $m4docker/system -I $m4docker/components ...

Example

Below is a simplest example of a top-level Dockerfile.m4 which you can compose. It will define a docker image containing self-built Intel media stack (libva, media driver, media sdk):

# cat Dockerfile.m4

include(begin.m4)
include(media-driver.m4)
include(msdk.m4)
include(end.m4)

FROM OS_NAME:OS_VERSION as build
BUILD_ALL()
CLEANUP()

FROM OS_NAME:OS_VERSION
INSTALL_ALL()

m4 include() directory effectively include project component template files. Media driver and Media SDK templates are included explicitly, other ingredients (such as libva) from which they depend will be fetched implicitly. Mind that order in which you include templates is important (in this order components will be built).

FROM directive is usual docker directive to define a layer. BUILD_ALL and INSTALL_ALL are project defined m4 macro helpers which actually add component build (or install) code from the template to docker layer definition. CLEANUP is another macro helper which allows to remove some build target depending on the desired docker image type. By default image is considered to be required for runtime, so CLEANUP removes header files, static library files and manuals.

begin.m4 and end.m4 are special project templates which should surround inclusion of all other component templates.

To produce a Dockerfile from this Dockerfile.m4 template, execute:

m4 -I $m4docker/system -I $m4docker/components \
  -D OS_NAME=ubuntu -D OS_VERSION=20.04 \
  Dockerfile.m4 > Dockerfile

Contributing

Contributions are welcomed. If you would like to provide a new template, please, review how to write new template. Make sure to extend tests to cover new template or changes to project core.

If you made any modifications to the project, run tests before submitting your change for review:

cmake .
ctest -V

onecontainer-templates's People

Contributors

luisfponce avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.