Skip to content

Commit

Permalink
Update Base image and YQ version (#73)
Browse files Browse the repository at this point in the history
Co-authored-by: Tamal Saha <[email protected]>
Co-authored-by: Raihan Khan <[email protected]>
  • Loading branch information
raihankhan and tamalsaha committed Dec 7, 2023
1 parent 07d1919 commit 34d0083
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 27 deletions.
22 changes: 9 additions & 13 deletions elasticsearch-dashboard-init/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
FROM debian:bullseye as builder

# ref: https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
ARG TARGETOS
ARG TARGETARCH

ENV DEBIAN_FRONTEND noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN true
FROM golang:1.21 AS yq

RUN set -x \
&& apt-get update \
&& apt-get install -y --no-install-recommends apt-transport-https ca-certificates curl unzip
&& apt-get install -y --no-install-recommends apt-transport-https ca-certificates

## build yq binary from ac-3.3.4 branch which has updated go dependencies
RUN set -x \
&& curl -fsSL -o yq https://github.com/mikefarah/yq/releases/download/3.3.0/yq_${TARGETOS}_${TARGETARCH} \
&& chmod 755 yq
&& git clone https://github.com/gomodules/yq.git \
&& cd yq \
&& git checkout ac-3.3.4 \
&& CGO_ENABLED=0 go build -v -o /yq yq.go

FROM {ELASTICSEARCH_DASHBOARD_IMAGE} as elasticsearch_dashboard

FROM alpine:3.13.1
FROM alpine:3.18.5

RUN apk add --no-cache bash
COPY scripts/dashboard-config-merger.sh /usr/local/bin/dashboard-config-merger.sh
COPY --from=builder /yq /usr/bin/yq
COPY --from=yq /yq /usr/bin/yq
COPY --from=elasticsearch_dashboard /usr/share/kibana/config /kibana/default-config

RUN chmod -c 755 /usr/local/bin/dashboard-config-merger.sh
Expand Down
24 changes: 10 additions & 14 deletions elasticsearch-init/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,25 @@
FROM debian:bullseye as builder

# ref: https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
ARG TARGETOS
ARG TARGETARCH

ENV DEBIAN_FRONTEND noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN true
FROM golang:1.21 AS yq

RUN set -x \
&& apt-get update \
&& apt-get install -y --no-install-recommends apt-transport-https ca-certificates curl unzip
&& apt-get install -y --no-install-recommends apt-transport-https ca-certificates

## build yq binary from ac-3.3.4 branch which has updated go dependencies
RUN set -x \
&& curl -fsSL -o yq https://github.com/mikefarah/yq/releases/download/3.3.0/yq_${TARGETOS}_${TARGETARCH} \
&& chmod 755 yq
&& git clone https://github.com/gomodules/yq.git \
&& cd yq \
&& git checkout ac-3.3.4 \
&& CGO_ENABLED=0 go build -v -o /yq yq.go

FROM {ELASTICSEARCH_IMAGE} as elasticsearch

FROM alpine:3.13.1
FROM alpine:3.18.5

RUN apk add --no-cache bash

COPY scripts/config-merger.sh /usr/local/bin/config-merger.sh
COPY --from=builder /yq /usr/bin/yq
COPY --from=yq /yq /usr/bin/yq
COPY --from=elasticsearch /usr/share/elasticsearch/config /elasticsearch/default-config
# COPY --from=elasticsearch /usr/share/elasticsearch/plugins/search-guard-7/sgconfig /elasticsearch/default-securityconfig

RUN chmod -c 755 /usr/local/bin/config-merger.sh

Expand Down

0 comments on commit 34d0083

Please sign in to comment.