Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
TymKh committed Oct 7, 2024
1 parent fdcedd3 commit f678fad
Show file tree
Hide file tree
Showing 29 changed files with 1,590 additions and 230 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# IDE
.vscode

.idea
# Builds
/build
.aider*
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# syntax=docker/dockerfile:1
FROM golang:1.23-alpine AS builder
ARG VERSION
RUN apk add --no-cache gcc sqlite-dev musl-dev
WORKDIR /build
# First only add go.mod and go.sum, then run go mod download to cache dependencies
# in a separate layer.
ADD go.mod go.sum /build/
RUN --mount=type=cache,target=/root/.cache/go-build go mod download
# Now add the rest of the source code and build the application.
ADD . /build/
RUN --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=1 GOOS=linux \
go build \
-trimpath \
-ldflags "-s -X github.com/flashbots/builder-hub/common.Version=${VERSION} -w -extldflags \"-static\"" \
-v \
-o builder-hub \
cmd/httpserver/main.go

FROM alpine:latest
RUN apk update && apk upgrade
RUN apk add --no-cache sqlite-dev
# See http://stackoverflow.com/questions/34729748/installed-go-binary-not-found-in-path-on-alpine-linux-docker
RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
WORKDIR /app
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /build/builder-hub /app/builder-hub
CMD ["/app/builder-hub"]
Loading

0 comments on commit f678fad

Please sign in to comment.