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

Add traffic generator 2 docker file. #817

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
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 = "generator"
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"]
Loading