This repository was archived by the owner on Feb 29, 2024. It is now read-only.
File tree 3 files changed +43
-0
lines changed
3 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,11 @@ COPY . .
11
11
12
12
RUN go build cmd/gortr/gortr.go
13
13
14
+ FROM alpine:latest as keygen
15
+
16
+ RUN apk --update --no-cache add openssl
17
+ RUN openssl ecparam -genkey -name prime256v1 -noout -outform pem > private.pem
18
+
14
19
FROM alpine:latest
15
20
ARG src_dir
16
21
@@ -19,4 +24,5 @@ RUN apk --update --no-cache add ca-certificates && \
19
24
USER rtr
20
25
21
26
COPY --from=builder ${src_dir}/gortr ${src_dir}/cmd/gortr/cf.pub /
27
+ COPY --from=keygen /private.pem /private.pem
22
28
ENTRYPOINT ["./gortr"]
Original file line number Diff line number Diff line change @@ -6,6 +6,11 @@ ARG src_uri
6
6
RUN apk --update --no-cache add git && \
7
7
go get -u $src_uri
8
8
9
+ FROM alpine:latest as keygen
10
+
11
+ RUN apk --update --no-cache add openssl
12
+ RUN openssl ecparam -genkey -name prime256v1 -noout -outform pem > private.pem
13
+
9
14
FROM alpine:latest
10
15
ARG src_uri
11
16
@@ -15,4 +20,5 @@ USER rtr
15
20
16
21
COPY --from=builder /go/bin/gortr /
17
22
COPY cmd/gortr/cf.pub /
23
+ COPY --from=keygen /private.pem /private.pem
18
24
ENTRYPOINT ["./gortr"]
Original file line number Diff line number Diff line change 42
42
$ go build cmd/gortr/gortr.go
43
43
```
44
44
45
+ ## With Docker
46
+
47
+ If you do not want to use Docker, please go to the next section.
48
+
49
+ If you have ** Docker** , you can start GoRTR with ` docker run -ti -p 8082:8082 cloudflare/gortr ` .
50
+ The containers contains Cloudflare's public signing key and an testing ECDSA private
51
+ key for the SSH server.
52
+
53
+ It will automatically download Cloudflare's prefix list and use the public key
54
+ to validate it.
55
+
56
+ You can now use any CLI attributes as long as they are after the image name:
57
+ ``` bash
58
+ $ docker run -ti -p 8083:8083 cloudflare/gortr -bind :8083
59
+ ```
60
+
61
+ If you want to build your own image of GoRTR:
62
+ ``` bash
63
+ $ docker build -t mygortr -f Dockerfile.gortr.prod .
64
+ $ docker run -ti mygortr -h
65
+ ```
66
+ It will download the code from GitHub and compile it with Go and also generate an ECDSA key for SSH.
67
+
68
+ Please note: if you plan to use SSH with Cloudflare's default container (` cloudflare/gortr ` ),
69
+ replace the key ` private.pem ` since it is a testing key that has been published.
70
+ An example is given below:
71
+
72
+ ``` bash
73
+ $ docker run -ti -v $PWD /mynewkey.pem:/private.pem cloudflare/gortr -ssh.bind :8083
74
+ ```
75
+
45
76
## Install it
46
77
47
78
``` bash
You can’t perform that action at this time.
0 commit comments