1
0
mirror of https://github.com/cloudflare/gortr.git synced 2024-05-19 06:50:10 +00:00
cloudflare-gortr/Dockerfile.gortr
Louis Poinsignon 108bf84ebb Docker and documentation update:
Updated README with more details on Docker and SSH
When creating a Docker container, generates an ECDSA key for SSH
2019-04-11 14:29:18 -07:00

29 lines
603 B
Docker

ARG src_dir="/gortr"
FROM golang:alpine as builder
ARG src_dir
RUN apk --update --no-cache add git && \
mkdir -p ${src_dir}
WORKDIR ${src_dir}
COPY . .
RUN go build cmd/gortr/gortr.go
FROM alpine:latest as keygen
RUN apk --update --no-cache add openssl
RUN openssl ecparam -genkey -name prime256v1 -noout -outform pem > private.pem
FROM alpine:latest
ARG src_dir
RUN apk --update --no-cache add ca-certificates && \
adduser -S -D -H -h / rtr
USER rtr
COPY --from=builder ${src_dir}/gortr ${src_dir}/cmd/gortr/cf.pub /
COPY --from=keygen /private.pem /private.pem
ENTRYPOINT ["./gortr"]