-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile-cronjob
55 lines (49 loc) · 2.1 KB
/
Dockerfile-cronjob
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
# Assumes ./container/secrets/secrets.env has been properly
# populated before invocation. Also, caller / script needs
# to populate ./container/secrets/cronjob-service-account.json
FROM debian:buster-slim as buildz
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -qq && \
apt-get install -y --no-install-recommends \
git build-essential automake autoconf \
libxml2-dev libboost-dev libboost-program-options-dev \
libboost-date-time-dev libboost-filesystem-dev \
libboost-thread-dev libboost-iostreams-dev \
libosmpbf-dev osmpbf-bin libprotobuf-dev pkg-config \
ca-certificates curl gettext-base
RUN mkdir -p /src
WORKDIR /src
RUN git clone https://github.com/zerebubuth/planet-dump-ng
WORKDIR planet-dump-ng
RUN ./autogen.sh
RUN ./configure
RUN make
WORKDIR /src
RUN curl https://storage.googleapis.com/pub/gsutil.tar.gz -o gsutil.tar.gz
COPY ./container/tools/subst /tmp
COPY ./container/secrets/secrets.env /tmp
COPY ./container/config/cronjob/boto.in /tmp
RUN cat /tmp/secrets.env > /tmp/x && \
echo 'echo ${EDITOR_DB_HOST}:*:${EDITOR_DB_NAME}:karttaweb:${EDITOR_SQL_KARTTAWEB_PASSWORD}' >>/tmp/x && \
/bin/sh /tmp/x > ~/.pgpass && chmod 0600 ~/.pgpass && rm -f /tmp/x
RUN /tmp/subst /tmp/secrets.env \
/tmp/boto.in /root/boto && rm -f /tmp/*
FROM debian:buster-slim
RUN apt-get update -qq && \
apt-get install -y --no-install-recommends \
libxml2 libprotobuf17 libprotobuf-lite17 \
libboost-filesystem1.67 libboost-thread1.67 \
libboost-date-time1.67 libboost-system1.67 \
libboost-iostreams1.67 \
osmium-tool osm2pgsql postgresql-client python
COPY --from=buildz /src/planet-dump-ng/planet-dump-ng /usr/bin
COPY --from=buildz /root/boto /root/.boto
COPY --from=buildz /src/gsutil.tar.gz /tmp
COPY --from=buildz /root/.pgpass /root/.pgpass
RUN tar xzf /tmp/gsutil.tar.gz -C /usr/local && \
rm /tmp/gsutil.tar.gz && \
ln -s /usr/local/gsutil/gsutil /usr/local/bin/gsutil
COPY ./k8s/cronjobs/dump-editor-db /etc/dump-editor-db
COPY ./k8s/cronjobs/tegola-update /etc/tegola-update
COPY ./k8s/cronjobs/tegola-update.py /etc/tegola-update.py
ENTRYPOINT ["tail", "-f", "/dev/null"]