Skip to content

Commit dc6fb6e

Browse files
Merge pull request #1892 from periklis/migrate-ubi
Migrate image building to a single UBI7-based Dockerfile
2 parents 7ba7fcd + 676cecb commit dc6fb6e

16 files changed

+121
-325
lines changed

curator/Dockerfile

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM rhel7:7-released
1+
FROM ubi7/python-36:latest
22

33
MAINTAINER OpenShift Development <[email protected]>
44

@@ -16,27 +16,26 @@ ENV HOME=/opt/app-root/src \
1616
CURATOR_TIMEOUT=300 \
1717
CURATOR_VER=5.8.1 \
1818
container=oci \
19-
LC_ALL=en_US.UTF-8
19+
LC_ALL=en_US.UTF-8
2020

21-
LABEL io.k8s.description="Curator elasticsearch container for elasticsearch deletion/archival" \
22-
io.k8s.display-name="Curator ${CURATOR_VER}" \
23-
io.openshift.tags="logging,elk,elasticsearch,curator"
21+
USER 0
22+
COPY . ${HOME}
2423

25-
RUN yum install -y python3 && \
26-
yum clean all && \
27-
ln -sf /usr/bin/python3 /usr/bin/python
24+
#
25+
# TODO Remove after openshift/release provides ubi7/python36 base image
26+
#
27+
RUN ${HOME}/install-centos7-deps.sh
2828

29-
COPY . ${HOME}
3029
RUN mkdir -p $(dirname "$CURATOR_CONF_LOCATION") && \
3130
touch ${CURATOR_CONF_LOCATION} && \
3231
chmod -R u+x ${HOME} && \
3332
chgrp -R 0 ${HOME} && \
3433
chmod -R g=u ${HOME}
34+
3535
WORKDIR ${HOME}/vendor
36-
RUN pip3 install $(ls . | grep -v curator) -q --no-index --find-links . && \
37-
pip3 install elasticsearch-curator* --no-index -q && \
38-
rm -rf $HOME/vendor && \
39-
ls /usr/local/bin/curator
36+
RUN pip install $(ls . | grep -v curator) -q --no-index --find-links . && \
37+
pip install elasticsearch-curator* --no-index -q && \
38+
rm -rf $HOME/vendor
4039

4140
WORKDIR ${HOME}
4241
USER 1001

curator/Dockerfile.centos7

Lines changed: 0 additions & 45 deletions
This file was deleted.

curator/Dockerfile.centos7

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Dockerfile

curator/install-centos7-deps.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
if [ -f /etc/centos-release ] ; then
3+
echo "Installing temporarily centos 7 deps for CI"
4+
yum install -y python3
5+
yum clean all
6+
ln -sf /usr/bin/python3 /usr/bin/python
7+
ln -sf /usr/bin/pip3 /usr/bin/pip
8+
fi

elasticsearch/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM openshift/ose-base:ubi7
1+
FROM ubi7:latest
22

33
MAINTAINER OpenShift Development <[email protected]>
44

elasticsearch/Dockerfile.centos7

Lines changed: 0 additions & 63 deletions
This file was deleted.

elasticsearch/Dockerfile.centos7

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Dockerfile.origin

elasticsearch/Dockerfile.origin

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
FROM ubi7:latest
2+
3+
MAINTAINER OpenShift Development <[email protected]>
4+
5+
EXPOSE 9200
6+
EXPOSE 9300
7+
USER 0
8+
9+
ENV ES_PATH_CONF=/etc/elasticsearch/ \
10+
ES_HOME=/usr/share/elasticsearch \
11+
ES_VER=6.8.1 \
12+
HOME=/opt/app-root/src \
13+
INSTANCE_RAM=512G \
14+
JAVA_VER=1.8.0 \
15+
JAVA_HOME=/usr/lib/jvm/jre \
16+
NODE_QUORUM=1 \
17+
PROMETHEUS_EXPORTER_VER=6.8.1.0 \
18+
OPENDISTRO_VER=0.10.1.0 \
19+
PLUGIN_LOGLEVEL=INFO \
20+
RECOVER_AFTER_NODES=1 \
21+
RECOVER_EXPECTED_NODES=1 \
22+
RECOVER_AFTER_TIME=5m \
23+
DHE_TMP_KEY_SIZE=2048 \
24+
RELEASE_STREAM=origin
25+
26+
ARG MAVEN_REPO_URL=https://repo1.maven.org/maven2/
27+
28+
RUN yum install -y --setopt=tsflags=nodocs --nogpgcheck \
29+
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \
30+
packages="java-${JAVA_VER}-openjdk-headless \
31+
PyYAML \
32+
hostname \
33+
openssl \
34+
zip \
35+
unzip \
36+
jq" && \
37+
yum install -y --setopt=tsflags=nodocs ${packages} && \
38+
rpm -V ${packages} && \
39+
yum clean all
40+
41+
ADD extra-jvm.options install-es.sh /var/tmp
42+
43+
RUN /var/tmp/install-es.sh
44+
45+
ADD sgconfig/ ${HOME}/sgconfig/
46+
ADD index_templates/ ${ES_HOME}/index_templates/
47+
ADD index_patterns/ ${ES_HOME}/index_patterns/
48+
ADD init/ ${ES_HOME}/init/
49+
ADD kibana_ui_objects/ ${ES_HOME}/kibana_ui_objects/
50+
ADD probe/ ${ES_HOME}/probe/
51+
ADD init.sh run.sh prep-install* install.sh ${HOME}/
52+
COPY utils/** /usr/local/bin/
53+
54+
ARG PROMETHEUS_EXPORTER_URL=https://github.com/vvanholl/elasticsearch-prometheus-exporter/releases/download/6.8.1.0/prometheus-exporter-6.8.1.0.zip
55+
ARG OPENDISTRO_URL=https://github.com/jcantrill/security/releases/download/v0.10.1.0/opendistro_security-0.10.1.0.zip
56+
57+
RUN ${HOME}/install.sh
58+
59+
WORKDIR ${HOME}
60+
USER 1000
61+
CMD ["sh", "/opt/app-root/src/run.sh"]

elasticsearch/install-es.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
set -euxo pipefail
3+
set -euo pipefail
44

55
# install Elasticsearch from zip distribution file
66
# put files in correct places in image

elasticsearch/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
set -euxo pipefail
3+
set -euo pipefail
44

55
ln -s /usr/local/bin/logging ${HOME}/logging
66

0 commit comments

Comments
 (0)