xenial 1.85 KB
Newer Older
1
FROM ubuntu:xenial AS apt
2
RUN apt-get update && \
3
    DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
4
        bzip2 \
5 6 7
        clang \
        cmake \
        curl \
8
        gcc \
9
        git \
10
        krb5-user \
11
        libcurl4-gnutls-dev \
12
        libgcrypt20-dev \
13
        libkrb5-dev \
14
        libpcre3-dev \
15
        libssl-dev \
16
        libz-dev \
17
        make \
18
        ninja-build \
19
        openjdk-8-jre-headless \
20
        openssh-server \
21
        openssl \
22
        pkgconf \
23
        python \
24
        sudo \
25 26 27
        valgrind \
        && \
    rm -rf /var/lib/apt/lists/*
28

29
FROM apt AS mbedtls
30
RUN cd /tmp && \
31
    curl --location --silent --show-error https://tls.mbed.org/download/mbedtls-2.16.2-apache.tgz | \
32
    tar -xz && \
33 34
    cd mbedtls-2.16.2 && \
    scripts/config.pl set MBEDTLS_MD4_C 1 && \
35 36
    CFLAGS=-fPIC cmake -G Ninja -DENABLE_PROGRAMS=OFF -DENABLE_TESTING=OFF -DUSE_SHARED_MBEDTLS_LIBRARY=OFF -DUSE_STATIC_MBEDTLS_LIBRARY=ON . && \
    ninja install && \
37 38
    cd .. && \
    rm -rf mbedtls-2.16.2
39

40
FROM mbedtls AS libssh2
41
RUN cd /tmp && \
42
    curl --insecure --location --silent --show-error https://www.libssh2.org/download/libssh2-1.8.2.tar.gz | \
43
    tar -xz && \
44
    cd libssh2-1.8.2 && \
45
    CFLAGS=-fPIC cmake -G Ninja -DBUILD_SHARED_LIBS=ON -DCRYPTO_BACKEND=Libgcrypt . && \
46 47 48
    ninja install && \
    cd .. && \
    rm -rf libssh2-1.8.2
49

50 51
FROM libssh2 AS valgrind
RUN cd /tmp && \
52
    curl --insecure --location --silent --show-error https://sourceware.org/pub/valgrind/valgrind-3.15.0.tar.bz2 | \
53
    tar -xj && \
54 55 56 57 58 59 60 61
    cd valgrind-3.15.0 && \
    ./configure && \
    make && \
    make install && \
    cd .. && \
    rm -rf valgrind-3.15.0

FROM valgrind AS configure
62 63
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod a+x /usr/local/bin/entrypoint.sh
64
RUN mkdir /var/run/sshd
65

Edward Thomson committed
66
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]