-
Notifications
You must be signed in to change notification settings - Fork 112
/
Copy pathDockerfile.download
30 lines (21 loc) · 1.29 KB
/
Dockerfile.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
# Builds an image using a pre-built connector distribution archive from couchbase.com.
# First stage downloads and unzips the connector distribution archive
FROM redhat/ubi8-minimal:latest AS build
# Version of the connector to download. See release notes for valid versions
# https://docs.couchbase.com/elasticsearch-connector/current/release-notes.html
ARG VERSION
RUN [ -z "$VERSION" ] && echo "Missing VERSION argument. Must specify like: --build-arg VERSION=<connector-version>" && exit 1 || true
RUN curl -s https://packages.couchbase.com/clients/connectors/elasticsearch/${VERSION}/couchbase-elasticsearch-connector-${VERSION}.zip -o /couchbase-elasticsearch-connector.zip
RUN microdnf install unzip
RUN unzip -o -d / /couchbase-elasticsearch-connector.zip
RUN mv /couchbase-elasticsearch-connector-${VERSION} /couchbase-elasticsearch-connector
# Second stage uses the unzipped connector distribution to build the final image
FROM registry.access.redhat.com/ubi8/openjdk-17-runtime:1.21
ARG CBES_HOME=/opt/couchbase-elasticsearch-connector
# Set owner to jboss to appease the base image.
COPY --chown=jboss:root --from=build /couchbase-elasticsearch-connector $CBES_HOME
VOLUME [ "$CBES_HOME/config", "$CBES_HOME/secrets" ]
ENV PATH="$CBES_HOME/bin:$PATH"
WORKDIR $CBES_HOME
EXPOSE 31415
ENTRYPOINT [ "cbes" ]