File: Dockerfile.build_server_deb

package info (click to toggle)
grr 3.1.0.2+dfsg-3~bpo9+1
  • links: PTS, VCS
  • area: main
  • in suites: stretch-backports
  • size: 46,960 kB
  • ctags: 19,666
  • sloc: python: 115,808; cpp: 7,535; sh: 1,051; xml: 288; ansic: 224; makefile: 90; asm: 13
file content (57 lines) | stat: -rw-r--r-- 2,077 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# A Docker container that builds the server deb.
# Template release for grr-responses-templates must be done before building the
# server deb.
#
# See here for build instructions:
# https://github.com/google/grr-doc/blob/master/admin.adoc#building-the-server-debian-package

# Building on xenial gets us Python 2.7.11
FROM ubuntu:xenial
MAINTAINER Greg Castle github@mailgreg.com

# The 32bit libs listed here are required for PyInstaller, which isn't used on
# the server but picked up by the deb library checker as missing. PyInstaller is
# a client python package dependency and we need that package for the
# ClientBuild entry point for repacking. Disabling the library check might
# result in missing something important. Adding the build deps here seems like
# the least bad option.
RUN apt-get update && \
  apt-get install -y \
  debhelper \
  dh-systemd \
  dh-virtualenv \
  dpkg-dev \
  lib32z1 \
  libc6-i386 \
  libssl-dev \
  python2.7-dev \
  python-pip \
  prelink \
  rpm \
  wget \
  zip && \
  pip install --upgrade pip && \
  pip install virtualenv && \
  pip install --upgrade setuptools && \
  virtualenv /tmp/grr-env

# Pull dependencies and templates from pypi and build wheels into a temp
# virtualenv. All we are doing here is populating the pip cache so it can be
# cached by docker and make the server build go fast.
RUN . /tmp/grr-env/bin/activate && \
pip install wheel && \
pip install --pre grr-response-server && \
pip install -f https://storage.googleapis.com/releases.grr-response.com/index.html grr-response-templates && \
deactivate

# Copy the GRR code over and build the deb. This will create a fresh virtualenv
# and install from src, but re-use the precompiled wheels via pip and docker
# caching.
COPY . /usr/src/grr/
WORKDIR /usr/src/grr

# You may see SyntaxError: invalid syntax from pexpect, this seems to be
# harmless since this code is only used when building clients from source:
# https://github.com/pexpect/pexpect/issues/220
# https://bugs.launchpad.net/ubuntu/+source/ubuntu-make/+bug/1507871
RUN dpkg-buildpackage -us -uc