Skip to content

Commit

Permalink
Add traffic generator 2 docker file. (#817)
Browse files Browse the repository at this point in the history
Signed-off-by: Cody Littley <cody@eigenlabs.org>
  • Loading branch information
cody-littley authored Oct 22, 2024
1 parent febcd95 commit 36137c3
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,21 @@ target "traffic-generator-internal" {
]
}

target "traffic-generator2" {
context = "."
dockerfile = "./trafficgenerator2.Dockerfile"
target = "generator2"
tags = ["${REGISTRY}/${REPO}/traffic-generator2:${BUILD_TAG}"]
}

target "traffic-generator2-internal" {
inherits = ["traffic-generator2"]
tags = ["${REGISTRY}/eigenda-traffic-generator2:${BUILD_TAG}",
"${REGISTRY}/eigenda-traffic-generator2:${GIT_SHA}",
"${REGISTRY}/eigenda-traffic-generator2:sha-${GIT_SHORT_SHA}",
]
}

target "dataapi" {
context = "."
dockerfile = "./Dockerfile"
Expand Down
20 changes: 20 additions & 0 deletions trafficgenerator2.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM golang:1.21.1-alpine3.18 as builder

RUN apk add --no-cache make musl-dev linux-headers gcc git jq bash

WORKDIR /app

# Copy Entire Repo here in order to not copy individual dependencies
COPY . .

WORKDIR /app/tools/traffic

RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go build -o ./bin/generator ./cmd2

FROM alpine:3.18 as generator2

COPY --from=builder /app/tools/traffic/bin/generator /usr/local/bin

ENTRYPOINT ["generator"]

0 comments on commit 36137c3

Please sign in to comment.