2024-07-17 09:29:46 +00:00
|
|
|
FROM golang:1.21-bullseye AS builder
|
|
|
|
|
2024-09-09 08:50:41 +00:00
|
|
|
ARG TARGETPLATFORM
|
|
|
|
|
|
|
|
# Install mkcert
|
|
|
|
RUN curl -JL "https://dl.filippo.io/mkcert/latest?for=$TARGETPLATFORM" -o /usr/local/bin/mkcert && \
|
|
|
|
chmod +x /usr/local/bin/mkcert
|
|
|
|
|
2024-07-17 09:29:46 +00:00
|
|
|
# Copy files into image
|
|
|
|
WORKDIR /app
|
|
|
|
COPY . .
|
|
|
|
|
2024-09-09 08:50:41 +00:00
|
|
|
RUN go mod download
|
2024-07-18 04:52:37 +00:00
|
|
|
|
2024-07-17 09:29:46 +00:00
|
|
|
# Build the binary
|
|
|
|
RUN go build -v -o nitro .
|
2024-07-19 05:27:46 +00:00
|
|
|
RUN go build -o nitro-bridge cmd/start-bridge/main.go
|
2024-07-17 09:29:46 +00:00
|
|
|
|
2024-07-23 06:40:19 +00:00
|
|
|
|
2024-07-17 09:29:46 +00:00
|
|
|
# Reduce image size
|
|
|
|
FROM debian:bullseye-slim
|
|
|
|
RUN apt-get update
|
2024-09-03 10:10:08 +00:00
|
|
|
RUN apt-get install -y jq netcat ca-certificates
|
2024-07-17 09:29:46 +00:00
|
|
|
RUN rm -rf /var/lib/apt/lists/*
|
2024-07-18 04:52:37 +00:00
|
|
|
|
2024-07-17 09:29:46 +00:00
|
|
|
WORKDIR /app
|
2024-07-18 04:52:37 +00:00
|
|
|
|
2024-07-17 09:29:46 +00:00
|
|
|
COPY --from=builder /app/nitro .
|
2024-07-19 05:27:46 +00:00
|
|
|
COPY --from=builder /app/nitro-bridge .
|
|
|
|
COPY --from=builder /usr/local/bin/mkcert /usr/local/bin/mkcert
|