forked from google/certificate-transparency
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile-ct-mirror
48 lines (47 loc) · 1.86 KB
/
Dockerfile-ct-mirror
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
FROM ubuntu:14.04
RUN echo 'Building new CT Mirror Docker image...'
RUN apt-get update && \
apt-get install -y software-properties-common && \
apt-get update && \
apt-get install -qqy \
ca-certificates
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