-
Notifications
You must be signed in to change notification settings - Fork 22
/
Dockerfile_5.2.j2
78 lines (65 loc) · 2.91 KB
/
Dockerfile_5.2.j2
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{%- set CRATE_TAR_GZ = "crate-{}.tar.gz".format(CRATE_VERSION) -%}
## -*- docker-image-name: "docker-crate" -*-
#
# Crate Dockerfile
# https://github.com/crate/docker-crate
#
FROM almalinux:9
# Install prerequisites and package updates and clean up repository indexes again
RUN yum install -y yum-utils \
&& yum makecache \
&& yum install -y python3 python3-pip \
&& yum clean all \
&& rm -rf /var/cache/yum
# Install CrateDB
RUN groupadd crate \
&& useradd -u 1000 -g crate -d /crate crate \
&& export PLATFORM="$( \
case $(uname --m) in \
x86_64) echo x64_linux ;; \
aarch64) echo aarch64_linux ;; \
esac)" \
&& export CRATE_URL={{ CRATE_RELEASE_URL }}/${PLATFORM}/{{ CRATE_TAR_GZ }} \
&& curl -fSL -O ${CRATE_URL} \
&& curl -fSL -O ${CRATE_URL}.asc \
&& export GNUPGHOME="$(mktemp -d)" \
&& gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 90C23FC6585BC0717F8FBFC37FAAE51A06F6EAEB \
&& gpg --batch --verify {{ CRATE_TAR_GZ }}.asc {{ CRATE_TAR_GZ }} \
&& rm -rf "$GNUPGHOME" {{ CRATE_TAR_GZ }}.asc \
&& tar -xf {{ CRATE_TAR_GZ }} -C /crate --strip-components=1 \
&& rm {{ CRATE_TAR_GZ }}
# Install crash
RUN curl -fSL -O {{ CRASH_URL }} \
&& curl -fSL -O {{ CRASH_URL }}.asc \
&& export GNUPGHOME="$(mktemp -d)" \
&& gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 90C23FC6585BC0717F8FBFC37FAAE51A06F6EAEB \
&& gpg --batch --verify crash_standalone_{{ CRASH_VERSION }}.asc crash_standalone_{{ CRASH_VERSION }} \
&& rm -rf "$GNUPGHOME" crash_standalone_{{ CRASH_VERSION }}.asc \
&& mv crash_standalone_{{ CRASH_VERSION }} /usr/local/bin/crash \
&& chmod +x /usr/local/bin/crash
ENV PATH /crate/bin:$PATH
# Default heap size for Docker, can be overwritten by args
ENV CRATE_HEAP_SIZE 512M
RUN mkdir -p /data/data /data/log
VOLUME /data
WORKDIR /data
# http: 4200 tcp
# transport: 4300 tcp
# postgres protocol ports: 5432 tcp
EXPOSE 4200 4300 5432
# These COPY commands have been moved before the last one due to the following issues:
# https://github.com/moby/moby/issues/37965#issuecomment-448926448
# https://github.com/moby/moby/issues/38866
COPY --chown=1000:0 config/crate.yml /crate/config/crate.yml
COPY --chown=1000:0 config/log4j2.properties /crate/config/log4j2.properties
LABEL maintainer="Crate.io <[email protected]>" \
org.opencontainers.image.created="{{ BUILD_TIMESTAMP }}" \
org.opencontainers.image.title="crate" \
org.opencontainers.image.description="CrateDB is a distributed SQL database that handles massive amounts of machine data in real-time." \
org.opencontainers.image.url="https://crate.io/products/cratedb/" \
org.opencontainers.image.source="https://github.com/crate/docker-crate" \
org.opencontainers.image.vendor="Crate.io" \
org.opencontainers.image.version="{{ CRATE_VERSION }}"
COPY docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["crate"]