fix(docker): support non amd64 dockerize in setup containers (#7091)

Co-authored-by: Pedro Silva <pedro@acryl.io>
This commit is contained in:
tony csoka 2023-01-23 10:25:33 +00:00 committed by GitHub
parent 54c5017efd
commit 1149cea1c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 7 deletions

View File

@ -3,10 +3,20 @@
# Defining environment
ARG APP_ENV=prod
FROM alpine:3 AS base
FROM golang:1.17-alpine3.15 AS binary
ENV DOCKERIZE_VERSION v0.6.1
RUN apk add --no-cache curl jq tar bash coreutils \
&& curl -L https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz | tar -C /usr/local/bin -xzv
WORKDIR /go/src/github.com/jwilder
RUN apk --no-cache --update add openssl git tar curl
WORKDIR /go/src/github.com/jwilder/dockerize
RUN go install github.com/jwilder/dockerize@$DOCKERIZE_VERSION
FROM alpine:3 AS base
RUN apk add --no-cache curl jq tar bash coreutils
COPY --from=binary /go/bin/dockerize /usr/local/bin
FROM base AS prod-install
@ -24,3 +34,4 @@ CMD if [ "$ELASTICSEARCH_USE_SSL" == "true" ]; then ELASTICSEARCH_PROTOCOL=https
&& if [[ "$SKIP_ELASTICSEARCH_CHECK" != "true" ]]; then \
dockerize -wait $ELASTICSEARCH_PROTOCOL://$ELASTICSEARCH_HOST:$ELASTICSEARCH_PORT -wait-http-header "${ELASTICSEARCH_HTTP_HEADERS}" -timeout 120s /create-indices.sh; \
else /create-indices.sh; fi

View File

@ -1,8 +1,18 @@
FROM alpine:3
FROM golang:1.17-alpine3.15 AS binary
ENV DOCKERIZE_VERSION v0.6.1
RUN apk add --no-cache mysql-client curl tar bash \
&& curl -sSL https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz | tar -C /usr/local/bin -xzv
WORKDIR /go/src/github.com/jwilder
RUN apk --no-cache --update add openssl git tar curl
WORKDIR /go/src/github.com/jwilder/dockerize
RUN go install github.com/jwilder/dockerize@$DOCKERIZE_VERSION
FROM alpine:3
COPY --from=binary /go/bin/dockerize /usr/local/bin
RUN apk add --no-cache mysql-client curl tar bash
COPY docker/mysql-setup/init.sql /init.sql
COPY docker/mysql-setup/init.sh /init.sh
@ -10,4 +20,5 @@ RUN chmod 755 init.sh
ENV DATAHUB_DB_NAME="datahub"
CMD dockerize -wait tcp://$MYSQL_HOST:$MYSQL_PORT -timeout 240s /init.sh
CMD dockerize -wait tcp://$MYSQL_HOST:$MYSQL_PORT -timeout 240s /init.sh