1# Build a file and proxy server with optional digest authentication
2
3# May require a more recent docker version than v1.13.1 so don't build from a Centos 7.9 machine
4
5FROM ubuntu:23.04
6
7# gettext-base is needed for envsubst used to expand Apache config on container startup
8RUN apt update && \
9 apt install --yes --no-install-recommends tzdata && \
10 ln -fs /usr/share/zoneinfo/Zulu /etc/localtime && \
11 dpkg-reconfigure --frontend noninteractive tzdata && \
12 apt-get install --yes --no-install-recommends \
13 apache2 \
14 gettext-base \
15 vim
16
17# Set application dir in container
18WORKDIR /app
19
20COPY docker/proxy/startup.sh ./
21COPY docker/proxy/chart_httpd.conf.tmpl ./
22COPY docker/proxy/run_apache.sh ./
23COPY docker/proxy/authdigest.tmpl ./
24
25RUN mkdir /var/www/auth && \
26 touch /var/www/auth/digest.pw
27
28# Write a VERSIONS file inside the image
29ARG PROXY_VCS_BRANCH
30ARG PROXY_VCS_TAG
31ARG PROXY_VCS_COMMIT
32ARG PROXY_BUILD_USER
33ARG PROXY_BUILD_HOST
34ARG PROXY_BUILD_DIR
35ARG PROXY_BUILD_DIRTY
36RUN echo "proxy.vcs.branch=${FRAMEWORK_VCS_BRANCH}\n\
37proxy.vcs.tag=${FRAMEWORK_VCS_TAG}\n\
38proxy.vcs.commit=${FRAMEWORK_VCS_COMMIT}\n\
39proxy.build.user=${FRAMEWORK_BUILD_USER}\n\
40proxy.build.host=${FRAMEWORK_BUILD_HOST}\n\
41proxy.build.dir=${FRAMEWORK_BUILD_dir}\n\
42proxy.build.dirty=${FRAMEWORK_BUILD_dirty}"\
43> VERSIONS
44
45# Set image labels
46LABEL "eum.chart.proxy.vcs.branch"="${FRAMEWORK_VCS_BRANCH}"
47LABEL "eum.chart.proxy.vcs.tag"="${FRAMEWORK_VCS_TAG}"
48LABEL "eum.chart.proxy.vcs.commit"="${FRAMEWORK_VCS_COMMIT}"
49LABEL "eum.chart.proxy.build.user"="${FRAMEWORK_BUILD_USER}"
50LABEL "eum.chart.proxy.build.host"="${FRAMEWORK_BUILD_HOST}"
51LABEL "eum.chart.proxy.build.dir"="${FRAMEWORK_BUILD_DIR}"
52LABEL "eum.chart.proxy.build.dirty"="${FRAMEWORK_BUILD_DIRTY}"
53
54ENTRYPOINT [ "./startup.sh" ]