forked from jrnd-io/jr
-
Notifications
You must be signed in to change notification settings - Fork 0
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
56 changed files
with
1,866 additions
and
598 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 |
---|---|---|
|
@@ -2,6 +2,7 @@ FROM golang AS builder | |
MAINTAINER Ugo Landini <[email protected]> | ||
|
||
ARG VERSION=0.3.9 | ||
ARG GOVERSION=$(go version) | ||
ARG USER=$(id -u -n) | ||
ARG TIME=$(date) | ||
|
||
|
@@ -12,7 +13,7 @@ COPY . . | |
RUN go install github.com/actgardner/gogen-avro/v10/cmd/...@latest | ||
RUN go generate pkg/generator/generate.go | ||
RUN go get -u -d -v | ||
RUN CGO_ENABLED=1 GOOS=linux go build -tags static_all -v -ldflags="-X 'github.com/ugol/jr/pkg/cmd.Version=${VERSION}' -X 'github.com/ugol/jr/pkg/cmd.BuildUser=${USER}' -X 'github.com/ugol/jr/pkg/cmd.BuildTime=${TIME}'" -o build/jr jr.go | ||
RUN CGO_ENABLED=1 GOOS=linux go build -tags static_all -v -ldflags="-X 'github.com/ugol/jr/pkg/cmd.Version=${VERSION}' -X 'github.com/ugol/jr/pkg/cmd.GoVersion=${GOVERSION}' -X 'github.com/ugol/jr/pkg/cmd.BuildUser=${USER}' -X 'github.com/ugol/jr/pkg/cmd.BuildTime=${TIME}'" -o build/jr jr.go | ||
|
||
FROM registry.access.redhat.com/ubi9/ubi-micro | ||
|
||
|
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ FROM golang:1.22-alpine AS builder | |
MAINTAINER Ugo Landini <[email protected]> | ||
|
||
ARG VERSION=0.3.9 | ||
ARG GOVERSION=$(go version) | ||
ARG USER=$(id -u -n) | ||
ARG TIME=$(date) | ||
|
||
|
@@ -23,7 +24,7 @@ WORKDIR /go/src/github.com/ugol/jr | |
COPY . . | ||
|
||
RUN go get -u -d -v | ||
RUN CGO_ENABLED=1 GOOS=linux go build -tags musl -v -ldflags="-X 'github.com/ugol/jr/cmd.Version=${VERSION}' -X 'github.com/ugol/jr/cmd.BuildUser=${USER}' -X 'github.com/ugol/jr/cmd.BuildTime=${TIME}'" -o build/jr jr.go | ||
RUN CGO_ENABLED=1 GOOS=linux go build -tags musl -v -ldflags="-X 'github.com/ugol/jr/cmd.Version=${VERSION}' 'github.com/ugol/jr/pkg/cmd.GoVersion=${GOVERSION}' -X 'github.com/ugol/jr/cmd.BuildUser=${USER}' -X 'github.com/ugol/jr/cmd.BuildTime=${TIME}'" -o build/jr jr.go | ||
|
||
FROM alpine | ||
COPY --from=builder /etc/passwd /etc/passwd | ||
|
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
FROM golang:1.22-alpine AS builder | ||
MAINTAINER Ugo Landini <[email protected]> | ||
|
||
ARG VERSION=0.3.9 | ||
ARG GOVERSION=$(go version) | ||
ARG USER=$(id -u -n) | ||
ARG TIME=$(date) | ||
|
||
RUN apk update \ | ||
&& apk add --no-cache git ca-certificates \ | ||
&& apk add --update gcc musl-dev libssl3 librdkafka-dev pkgconf \ | ||
&& update-ca-certificates | ||
|
||
RUN adduser \ | ||
--disabled-password \ | ||
--gecos "" \ | ||
--home "/home/jr" \ | ||
--shell "/bin/sh" \ | ||
--uid "100001" \ | ||
"jr-user" | ||
|
||
WORKDIR /go/src/github.com/ugol/jr | ||
COPY . . | ||
|
||
RUN go get -u -d -v | ||
RUN CGO_ENABLED=1 GOOS=linux go build \ | ||
-tags musl -v \ | ||
-ldflags="-X 'github.com/ugol/jr/cmd.Version=${VERSION}' 'github.com/ugol/jr/pkg/cmd.GoVersion=${GOVERSION}' -X 'github.com/ugol/jr/cmd.BuildUser=${USER}' -X 'github.com/ugol/jr/cmd.BuildTime=${TIME}' -linkmode external -w -s -extldflags '-static'" \ | ||
-a -o build/jr jr.go | ||
|
||
FROM scratch | ||
COPY --from=builder /etc/passwd /etc/passwd | ||
COPY --from=builder /etc/group /etc/group | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --from=builder /go/src/github.com/ugol/jr/templates/ /home/jr/.jr/templates/ | ||
COPY --from=builder /go/src/github.com/ugol/jr/config/ /home/jr/.jr/ | ||
COPY --from=builder /go/src/github.com/ugol/jr/pkg/producers/kafka/*.examples /home/jr/.jr/kafka/ | ||
COPY --from=builder /go/src/github.com/ugol/jr/build/jr /bin/jr | ||
|
||
USER jr-user:jr-user |
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 was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.