Install platform-specific mkcert

This commit is contained in:
Roy Crihfield 2024-09-09 16:50:41 +08:00
parent b3e58e8d74
commit f2fa7b5304

View File

@ -1,15 +1,16 @@
FROM golang:1.21-bullseye AS builder 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 # Copy files into image
WORKDIR /app WORKDIR /app
COPY . . COPY . .
# Install mkcert RUN go mod download
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
RUN go mod tidy
# Build the binary # Build the binary
RUN go build -v -o nitro . RUN go build -v -o nitro .