gobbq commented on code in PR #97: URL: https://github.com/apache/rocketmq-operator/pull/97#discussion_r867752619
########## Dockerfile: ########## @@ -0,0 +1,46 @@ +# Build the manager binary +FROM golang:1.16 as builder + +WORKDIR /workspace +# Copy the Go Modules manifests +COPY go.mod go.mod +COPY go.sum go.sum +# cache deps before building and copying source so that we don't need to re-download as much +# and so that source changes don't invalidate our downloaded layer +RUN go mod download + +# Copy the go source +COPY main.go main.go +COPY pkg/ pkg/ + +# Build +RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go + +# Use distroless as minimal base image to package the manager binary +# Refer to https://github.com/GoogleContainerTools/distroless for more details +#FROM gcr.io/distroless/static:nonroot +FROM openjdk:8-alpine + +# Install rocketmq release into image +RUN apk add --no-cache bash gettext nmap-ncat openssl busybox-extras +ENV ROCKETMQ_HOME /home/rocketmq +WORKDIR ${ROCKETMQ_HOME} +COPY rocketmq.zip ${ROCKETMQ_HOME}/rocketmq.zip +RUN set -eux; \ + apk add --virtual .build-deps unzip; \ + unzip rocketmq.zip; \ + mv rocketmq-all*/* . ; \ + chmod a+x * ; \ + rmdir rocketmq-all* ; \ + rm rocketmq.zip; \ Review Comment: yes, maybe -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
