forked from kubeshop/tracetest
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
42 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,24 @@ | ||
# Stage 1: Build | ||
FROM golang:1.21 AS builder | ||
FROM golang:1.20 as builder | ||
|
||
# Install build-essential for cgo | ||
RUN apt-get update && apt-get install -y build-essential | ||
WORKDIR /tracetest | ||
# Copy the Go Modules manifests | ||
COPY ./ ./ | ||
#RUN go mod download | ||
|
||
# Create a working directory | ||
WORKDIR /app | ||
|
||
# Copy source code | ||
COPY ./cli ./cli | ||
COPY ./server ./server | ||
# Build | ||
RUN make dist/tracetest-server | ||
# RUN cd server | ||
# RUN env GOOS=linux CGO_ENABLED=0 GO111MODULE=on /usr/local/go/bin/go build -o tracetest-server | ||
|
||
# Build the tracetest server and CLI | ||
RUN cd server && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -o /app/tracetest-server | ||
RUN cd cli && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -o /app/tracetest | ||
|
||
# Stage 2: Final Image | ||
FROM alpine | ||
|
||
WORKDIR /app | ||
|
||
# Copy the built binaries from the builder stage | ||
COPY --from=builder /app/server/tracetest-server /app/tracetest-server | ||
COPY --from=builder /app/tracetest /app/tracetest | ||
COPY --from=builder /tracetest/tracetest-server /app/tracetest-server | ||
|
||
# Adding /app folder on $PATH to allow users to call tracetest cli on docker | ||
ENV PATH="$PATH:/app" | ||
|
||
EXPOSE 11633/tcp | ||
# EXPOSE 11633/tcp | ||
|
||
ENTRYPOINT ["/app/tracetest-server", "serve"] | ||
ENTRYPOINT ["/app/tracetest-server", "serve"] |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.