Skip to content

Commit

Permalink
chore: copy SSL certificates in builder stage
Browse files Browse the repository at this point in the history
  • Loading branch information
anomit committed Oct 29, 2024
1 parent 3fa5fd2 commit ede2152
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ RUN CGO_ENABLED=0 GOOS=linux go build -o /snapshotter-local-collector ./cmd/main
# Use a minimal base image
FROM scratch

# Copy SSL certificates from the builder stage
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/

# Copy the binary from the builder stage
COPY --from=builder /snapshotter-local-collector /snapshotter-local-collector

Expand Down
7 changes: 3 additions & 4 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
)

func main() {
var wg sync.WaitGroup
helpers.InitLogger()
config.LoadConfig()
service.InitializeReportingService(config.SettingsObj.PowerloomReportingUrl, 5*time.Second)
Expand All @@ -28,9 +27,9 @@ func main() {
// Check both basic connection status and resource limits
if service.SequencerHostConn.Network().Connectedness(service.SequencerId) != network.Connected ||
service.IsResourceLimitExceeded() {

log.Warn("Connection issue or resource limit exceeded. Attempting atomic reset...")

if err := service.AtomicConnectionReset(); err != nil {
log.Errorf("Failed to perform atomic reset: %v", err)
} else {
Expand All @@ -40,7 +39,7 @@ func main() {
}
}
}()

var wg sync.WaitGroup
wg.Add(1)
go service.StartSubmissionServer(service.NewMsgServerImplV2())
wg.Wait()
Expand Down

0 comments on commit ede2152

Please sign in to comment.