2024-07-17 09:29:46 +00:00
|
|
|
FROM golang:1.21-bullseye AS builder
|
|
|
|
|
|
|
|
# Copy files into image
|
|
|
|
WORKDIR /app
|
|
|
|
COPY . .
|
|
|
|
|
2024-07-18 04:52:37 +00:00
|
|
|
# Install mkcert
|
|
|
|
RUN curl -JLO "https://dl.filippo.io/mkcert/latest?for=linux/amd64"
|
|
|
|
RUN chmod +x mkcert-v*-linux-amd64
|
|
|
|
RUN cp mkcert-v*-linux-amd64 /usr/local/bin/mkcert
|
|
|
|
|
2024-07-19 05:27:46 +00:00
|
|
|
RUN go mod tidy
|
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-07-18 04:52:37 +00:00
|
|
|
RUN apt-get install -y jq netcat
|
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
|