Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dockerfile): build Krakend from source to fix golang vesion mismatch #119

Merged
merged 1 commit into from
Dec 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ COPY multi_auth_plugin multi_auth_plugin

ARG TARGETARCH
ARG BUILDARCH
ARG KRAKEND_CE_VERSION
RUN git clone -b v${KRAKEND_CE_VERSION} https://github.com/krakendio/krakend-ce.git /krakend && cd /krakend && make build && cp krakend /usr/bin
RUN if [[ "$BUILDARCH" = "amd64" && "$TARGETARCH" = "arm64" ]] ; \
then \
curl -sL http://musl.cc/aarch64-linux-musl-cross.tgz | \
Expand Down Expand Up @@ -56,7 +58,8 @@ RUN cd /${SERVICE_NAME} && \
go build -o /go/bin/jwx . ; \
fi

FROM devopsfaith/krakend:${KRAKEND_CE_VERSION}

FROM alpine:${ALPINE_VERSION}

RUN apk update && apk add make bash gettext jq curl

Expand All @@ -66,16 +69,13 @@ WORKDIR /${SERVICE_NAME}

RUN mkdir -p /usr/local/lib/krakend/plugin && chmod 777 /usr/local/lib/krakend/plugin

COPY --from=build --chown=krakend:nogroup /${SERVICE_NAME}/grpc_proxy_plugin/grpc-proxy.so /usr/local/lib/krakend/plugin
COPY --from=build --chown=krakend:nogroup /${SERVICE_NAME}/multi_auth_plugin/multi-auth.so /usr/local/lib/krakend/plugin
COPY --from=build --chown=krakend:nogroup /go/bin/jwx /go/bin/jwx
COPY --from=build /usr/bin/krakend /usr/bin
COPY --from=build /${SERVICE_NAME}/grpc_proxy_plugin/grpc-proxy.so /usr/local/lib/krakend/plugin
COPY --from=build /${SERVICE_NAME}/multi_auth_plugin/multi-auth.so /usr/local/lib/krakend/plugin
COPY --from=build /go/bin/jwx /go/bin/jwx
RUN mkdir -p /instill && chmod 777 /instill

COPY .env .env
COPY Makefile Makefile
COPY config config
COPY scripts scripts

RUN chown krakend:nogroup -R .

USER krakend
Loading