2023-05-16 17:23:50 +00:00
|
|
|
# Use ubuntu because it's ez
|
|
|
|
FROM ubuntu:latest
|
|
|
|
|
2023-05-18 19:05:38 +00:00
|
|
|
WORKDIR /build
|
|
|
|
|
2023-05-16 17:23:50 +00:00
|
|
|
# Use openssl and golang to generate certificates
|
|
|
|
RUN apt-get update && \
|
2023-05-18 19:05:38 +00:00
|
|
|
apt-get install -y ca-certificates openssl golang xxd
|
2023-05-16 17:23:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Download the go modules
|
|
|
|
COPY go.mod go.sum ./
|
|
|
|
RUN go mod download
|
|
|
|
|
|
|
|
# Copy over the remaining files.
|
|
|
|
COPY . .
|
|
|
|
|
2023-05-18 19:05:38 +00:00
|
|
|
# Save the certificates to a volume
|
|
|
|
VOLUME /cert
|
|
|
|
|
2023-05-16 17:23:50 +00:00
|
|
|
# TODO support an output directory
|
2023-05-18 19:05:38 +00:00
|
|
|
CMD ./generate && cp localhost.* /cert
|