-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Create debug docker images for jaeger backends #2545
Changes from all commits
9ea34fe
3175215
cdd9cc2
6717613
37bce77
e19338c
2f352fc
3d95017
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
FROM alpine:latest as certs | ||
RUN apk add --update --no-cache ca-certificates | ||
ARG base_image | ||
ARG debug_image | ||
|
||
FROM scratch | ||
FROM $base_image AS release | ||
ARG TARGETARCH=amd64 | ||
ARG USER_UID=10001 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Ashmita152 was there a reason for TARGETARCH and USER_UID args to be repeated in each target, instead of being defined at the top of the file? If not, probably another opportunity to clean up / DRY the docker files. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, I will clean that today. |
||
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | ||
|
||
EXPOSE 5775/udp 6831/udp 6832/udp 5778 | ||
COPY agent-linux-$TARGETARCH /go/bin/agent-linux | ||
EXPOSE 5775/udp 6831/udp 6832/udp 5778/tcp | ||
ENTRYPOINT ["/go/bin/agent-linux"] | ||
USER ${USER_UID} | ||
|
||
FROM $debug_image AS debug | ||
ARG TARGETARCH=amd64 | ||
ARG USER_UID=10001 | ||
COPY agent-debug-linux-$TARGETARCH /go/bin/agent-linux | ||
EXPOSE 5775/udp 6831/udp 6832/udp 5778/tcp 12345/tcp | ||
ENTRYPOINT ["/go/bin/dlv", "exec", "/go/bin/agent-linux", "--headless", "--listen=:12345", "--api-version=2", "--accept-multiclient", "--log", "--"] | ||
USER ${USER_UID} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
FROM alpine:latest as certs | ||
RUN apk add --update --no-cache ca-certificates | ||
ARG base_image | ||
ARG debug_image | ||
|
||
FROM scratch | ||
FROM $base_image AS release | ||
ARG TARGETARCH=amd64 | ||
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | ||
|
||
EXPOSE 14250 | ||
COPY collector-linux-$TARGETARCH /go/bin/collector-linux | ||
EXPOSE 14250/tcp | ||
ENTRYPOINT ["/go/bin/collector-linux"] | ||
|
||
FROM $debug_image AS debug | ||
ARG TARGETARCH=amd64 | ||
COPY collector-debug-linux-$TARGETARCH /go/bin/collector-linux | ||
EXPOSE 12345/tcp 14250/tcp | ||
ENTRYPOINT ["/go/bin/dlv", "exec", "/go/bin/collector-linux", "--headless", "--listen=:12345", "--api-version=2", "--accept-multiclient", "--log", "--"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
FROM alpine:latest as certs | ||
RUN apk add --update --no-cache ca-certificates | ||
ARG base_image | ||
ARG debug_image | ||
|
||
FROM scratch | ||
FROM $base_image AS release | ||
ARG TARGETARCH=amd64 | ||
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | ||
|
||
EXPOSE 14270 | ||
EXPOSE 14271 | ||
COPY ingester-linux-$TARGETARCH /go/bin/ingester-linux | ||
EXPOSE 14270/tcp 14271/tcp | ||
ENTRYPOINT ["/go/bin/ingester-linux"] | ||
|
||
FROM $debug_image AS debug | ||
ARG TARGETARCH=amd64 | ||
COPY ingester-debug-linux-$TARGETARCH /go/bin/ingester-linux | ||
EXPOSE 12345/tcp 14270/tcp 14271/tcp | ||
ENTRYPOINT ["/go/bin/dlv", "exec", "/go/bin/ingester-linux", "--headless", "--listen=:12345", "--api-version=2", "--accept-multiclient", "--log", "--"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
FROM alpine:latest as certs | ||
RUN apk add --update --no-cache ca-certificates | ||
ARG base_image | ||
ARG debug_image | ||
|
||
FROM scratch | ||
FROM $base_image AS release | ||
ARG TARGETARCH=amd64 | ||
|
||
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | ||
|
||
EXPOSE 16686 | ||
COPY query-linux-$TARGETARCH /go/bin/query-linux | ||
|
||
EXPOSE 16686/tcp | ||
ENTRYPOINT ["/go/bin/query-linux"] | ||
|
||
FROM $debug_image AS debug | ||
ARG TARGETARCH=amd64 | ||
COPY query-debug-linux-$TARGETARCH /go/bin/query-linux | ||
EXPOSE 12345/tcp 16686/tcp | ||
ENTRYPOINT ["/go/bin/dlv", "exec", "/go/bin/query-linux", "--headless", "--listen=:12345", "--api-version=2", "--accept-multiclient", "--log", "--"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
VERSION := 1.0.0 | ||
ROOT_IMAGE ?= alpine:3.12 | ||
CERT_IMAGE := alpine:3.12 | ||
GOLANG_IMAGE := golang:1.15-alpine | ||
|
||
BASE_IMAGE := localhost/baseimg:$(VERSION)-$(shell echo $(ROOT_IMAGE) | tr : -) | ||
DEBUG_IMAGE := localhost/debugimg:$(VERSION)-$(shell echo $(GOLANG_IMAGE) | tr : -) | ||
|
||
create-baseimg-debugimg: create-baseimg create-debugimg | ||
|
||
create-baseimg: | ||
docker build -t $(BASE_IMAGE) \ | ||
--build-arg root_image=$(ROOT_IMAGE) \ | ||
--build-arg cert_image=$(CERT_IMAGE) \ | ||
docker/base | ||
|
||
create-debugimg: | ||
docker build -t $(DEBUG_IMAGE) \ | ||
--build-arg golang_image=$(GOLANG_IMAGE) \ | ||
docker/debug |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
ARG cert_image | ||
ARG root_image | ||
|
||
FROM $cert_image AS cert | ||
RUN apk add --update --no-cache ca-certificates | ||
|
||
FROM $root_image | ||
COPY --from=cert /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
ARG golang_image | ||
|
||
FROM $golang_image AS build | ||
ENV GOPATH /go | ||
RUN apk add --update --no-cache ca-certificates make git && \ | ||
go get github.com/go-delve/delve/cmd/dlv && \ | ||
cd /go/src/github.com/go-delve/delve && \ | ||
make install | ||
|
||
FROM $golang_image | ||
COPY --from=build /go/bin/dlv /go/bin/dlv | ||
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the extra step
make create-baseimg-debugimg
needed here but not in DOCKER step in L73?Also, why not call it from
./scripts/travis/build-all-in-one-image.sh
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that script calls: make docker -> make docker-images-only -> make docker-images-jaeger-backend-debug which has dependencies on create-baseimg and create-debugimg.
We can do it if you think that is the better place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably be done after #2325, as it touches this code as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if need to support multi arch for other components.
base images need to published with multi arch too.
or just upgrade Dockerfile like https://github.com/morlay/jaeger/blob/master/cmd/all-in-one/Dockerfile