5 # rocker build -f Rockerfile.piglit [--attach] \
6 # [--var IMAGE=freedesktop/mesa] # freedesktop/mesa, myrepo/myproyect, ... \
7 # [--var TAG=piglit] # piglit-17.0, piglit-13.0, ... \
8 # [--var PARENT=ubuntu:xenial] # ubuntu:xenial, freedesktop/mesa:17.3, ...
11 # Environment variables that are used in the build:
12 # - MAKEFLAGS: flags to pass to make (e.g., "-j8")
13 # - CCACHE_DIR: ccache directory (default: ~/.ccache)
18 # mkdir -p -m777 ~/my_results_dir
19 # docker run --privileged --rm -t -v ~/my_results_dir:/results:Z \
20 # -v /tmp/.X11-unix:/tmp/.X11-unix freedesktop/mesa:piglit
24 {{ $image := (or .IMAGE "freedesktop/mesa") }}
25 {{ $parent_image := (or .PARENT "ubuntu:xenial") }}
26 {{ $ccachedir := (or .Env.CCACHE_DIR "~/.ccache") }}
28 FROM {{ $parent_image }}
30 LABEL maintainer "Andres Gomez <agomez@igalia.com>"
37 && apt-get -y --no-install-recommends install sudo gcc g++ ccache \
38 git pkg-config bash-completion cmake \
39 libz-dev libpng-dev libgl-dev libegl1-mesa-dev libwaffle-dev \
40 python3-setuptools python3-pip \
41 && rm -fr /var/lib/apt/lists/*
43 RUN pip3 install numpy six mako
45 RUN getent passwd local > /dev/null || adduser --gecos "" local && passwd -d local && adduser local sudo
49 {{ if .Env.MAKEFLAGS }}
50 ENV MAKEFLAGS={{ .Env.MAKEFLAGS }}
55 MOUNT {{ $ccachedir }}:/home/local/.ccache:Z
57 RUN sudo chown -R local:local /home/local/.ccache
59 ENV PATH=/usr/lib/ccache:$PATH
61 ADD . /home/local/piglit
62 RUN sudo chown -R local:local /home/local/piglit
64 WORKDIR /home/local/piglit
66 ATTACH [ "/bin/bash" ]
68 RUN cmake . && cmake --build .
73 TAG {{ $image }}:{{ .TAG }}