Skip to content

Commit

Permalink
add osusergo
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricve committed Jun 28, 2023
1 parent 4b8b6bf commit bf97bd7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ RUN cat /go/src/github.com/kerberos-io/agent/machinery/version

RUN cd /go/src/github.com/kerberos-io/agent/machinery && \
go mod download && \
go build -tags timetzdata,netgo --ldflags '-s -w -extldflags "-static -latomic"' main.go && \
go build -tags timetzdata,netgo,osusergo --ldflags '-s -w -extldflags "-static -latomic"' main.go && \
mkdir -p /agent && \
mv main /agent && \
mv version /agent && \
Expand Down
6 changes: 3 additions & 3 deletions machinery/src/database/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ func New() *mongo.Client {
password := os.Getenv("MONGODB_PASSWORD")
authentication := "SCRAM-SHA-256"

ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()

_init_ctx.Do(func() {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()

_instance = new(DB)
mongodbURI := fmt.Sprintf("mongodb://%s:%s@%s", username, password, host)
if replicaset != "" {
Expand Down

0 comments on commit bf97bd7

Please sign in to comment.