-
Notifications
You must be signed in to change notification settings - Fork 479
/
Dockerfile
61 lines (51 loc) · 2.8 KB
/
Dockerfile
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
55
56
57
58
59
60
61
# Copyright 2023 Forschungszentrum Jülich GmbH
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# This build arg must be given or build will fail
ARG SOLR_VERSION
# We simply have this intermediate stage here without any activity to copy the default configset over
FROM solr:${SOLR_VERSION} AS solr
# Let's build us a baker
# WARNING:
# Do not upgrade the tag to :3 or :3.19 until https://pkgs.alpinelinux.org/package/v3.19/main/x86_64/c-ares is at v1.26.0+!
# See https://github.com/IQSS/dataverse/issues/10413 for more information.
FROM alpine:3.18
ENV SCRIPT_DIR="/scripts" \
SECRETS_DIR="/secrets" \
SOLR_TEMPLATE="/template"
ENV PATH="${PATH}:${SCRIPT_DIR}" \
BOOTSTRAP_DIR="${SCRIPT_DIR}/bootstrap"
ARG APK_PACKAGES="curl bind-tools netcat-openbsd jq bash dumb-init wait4x ed postgresql-client"
RUN true && \
# Install necessary software and tools
apk add --no-cache ${APK_PACKAGES} && \
# Make our working directories
mkdir -p ${SCRIPT_DIR} ${SECRETS_DIR} ${SOLR_TEMPLATE}
# Get in the scripts
COPY maven/scripts maven/solr/update-fields.sh ${SCRIPT_DIR}/
# Copy the data from scripts/api that provide the common base setup you'd get from the installer.
# ".dockerignore" will take care of taking only the bare necessities
COPY maven/setup ${SCRIPT_DIR}/bootstrap/base/
# Make the scripts executable
RUN chmod +x ${SCRIPT_DIR}/*.sh ${BOOTSTRAP_DIR}/*/*.sh
# Copy the Solr config bits
COPY --from=solr /opt/solr/server/solr/configsets/_default ${SOLR_TEMPLATE}/
COPY maven/solr/*.xml ${SOLR_TEMPLATE}/conf/
RUN rm ${SOLR_TEMPLATE}/conf/managed-schema.xml
# Set the entrypoint to tini (as a process supervisor)
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
# By default run a script that will print a help message and terminate
CMD ["help.sh"]
LABEL org.opencontainers.image.created="@git.build.time@" \
org.opencontainers.image.authors="Research Data Management at FZJ <forschungsdaten@fz-juelich.de>" \
org.opencontainers.image.url="https://guides.dataverse.org/en/latest/container/" \
org.opencontainers.image.documentation="https://guides.dataverse.org/en/latest/container/" \
org.opencontainers.image.source="https://github.com/IQSS/dataverse/tree/develop/modules/container-configbaker" \
org.opencontainers.image.version="@project.version@" \
org.opencontainers.image.revision="@git.commit.id.abbrev@" \
org.opencontainers.image.vendor="Global Dataverse Community Consortium" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.title="Dataverse Config Baker Image" \
org.opencontainers.image.description="This container image configures Dataverse and provides other tooling"