31 lines
680 B
Docker
31 lines
680 B
Docker
FROM golang:1.21-bullseye AS builder
|
|
|
|
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
|
|
|
|
# Copy files into image
|
|
WORKDIR /app
|
|
COPY . .
|
|
|
|
RUN go mod download
|
|
|
|
# Build the binary
|
|
RUN go build -v -o nitro .
|
|
RUN go build -o nitro-bridge cmd/start-bridge/main.go
|
|
|
|
|
|
# Reduce image size
|
|
FROM debian:bullseye-slim
|
|
RUN apt-get update
|
|
RUN apt-get install -y jq netcat ca-certificates
|
|
RUN rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=builder /app/nitro .
|
|
COPY --from=builder /app/nitro-bridge .
|
|
COPY --from=builder /usr/local/bin/mkcert /usr/local/bin/mkcert
|