File: Dockerfile-ct-mirror

package info (click to toggle)
golang-github-google-certificate-transparency 0.0~git20160709.0.0f6e3d1~ds1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, sid, trixie
  • size: 5,676 kB
  • sloc: cpp: 35,278; python: 11,838; java: 1,911; sh: 1,885; makefile: 950; xml: 520; ansic: 225
file content (50 lines) | stat: -rw-r--r-- 1,966 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
FROM ubuntu
RUN echo 'Building new CT Mirror Docker image...'
RUN apt-get update && \
    apt-get install -y software-properties-common && \
    apt-add-repository -y ppa:jbboehr/coreos && \
    apt-get update && \
    apt-get install -qqy \
        ca-certificates \
        etcdctl
RUN groupadd -r ctlog && useradd -r -g ctlog ctlog
RUN mkdir /mnt/ctmirror
COPY cpp/server/ct-mirror /usr/local/bin/
COPY cpp/tools/ct-clustertool /usr/local/bin/
COPY cloud/keys /usr/local/etc/keys
VOLUME /mnt/ctmirror
CMD cd /mnt/ctmirror/ && \
    if [ ! -d logs ]; then mkdir logs; fi && \
    MY_IP=$(awk "/${HOSTNAME}/ {print \$1}" < /etc/hosts) && \
    export V_LEVEL=${V_LEVEL:-0} && \
    export NUM_HTTP_SERVER_THREADS=${NUM_HTTP_SERVER_THREADS:-32} && \
    echo "My IP: ${MY_IP}" && \
    echo "Container: ${CONTAINER_HOST}" && \
    echo "Etcd: ${ETCD_SERVERS}" && \
    echo "Target: ${TARGET_LOG_URL}" && \
    echo "Target TLS version: ${TARGET_LOG_TLS_VERSION}" && \
    echo "Target Key: ${TARGET_LOG_PUBLIC_KEY}" && \
    echo "Project: ${PROJECT}" && \
    echo "Monitoring: ${MONITORING}" && \
    ulimit -c unlimited && \
    /usr/local/bin/ct-mirror \
        --port=80 \
        --server=${CONTAINER_HOST} \
        --log_dir=/mnt/ctmirror/logs \
        --leveldb_db=/mnt/ctmirror/mirror.ldb \
        --etcd_servers="${ETCD_SERVERS}" \
        --num_http_server_threads=${NUM_HTTP_SERVER_THREADS} \
        --target_public_key=/usr/local/etc/keys/${TARGET_LOG_PUBLIC_KEY} \
        --target_log_uri=${TARGET_LOG_URL} \
        --monitoring=${MONITORING} \
        --google_compute_monitoring_base_url="https://www.googleapis.com/cloudmonitoring/v2beta2/projects/${PROJECT}" \
        --v=${V_LEVEL}; \
    if [ -e core ]; then \
      CORE_DIR="/mnt/ctmirror/cores/$(date +%s)"; \
      mkdir -p ${CORE_DIR}; \
      cp -v core ${CORE_DIR}; \
      cp -v /usr/local/bin/ct-mirror ${CORE_DIR}; \
      echo "Core saved to ${CORE_DIR}"; \
    fi

EXPOSE 80