|
@@ -1,20 +1,36 @@
|
1
|
|
-# build Oragono
|
2
|
|
-FROM golang:rc AS build-env
|
|
1
|
+## build Oragono
|
|
2
|
+FROM golang:rc-alpine AS build-env
|
3
|
3
|
|
4
|
|
-RUN apt-get install -y git
|
|
4
|
+RUN apk add --no-cache git
|
|
5
|
+RUN apk add --no-cache make
|
|
6
|
+RUN apk add --no-cache curl
|
5
|
7
|
|
|
8
|
+# install goreleaser
|
|
9
|
+RUN mkdir -p /go/src/github.com/goreleaser
|
|
10
|
+WORKDIR /go/src/github.com/goreleaser
|
|
11
|
+
|
|
12
|
+RUN git clone https://github.com/goreleaser/goreleaser.git
|
|
13
|
+WORKDIR /go/src/github.com/goreleaser/goreleaser
|
|
14
|
+RUN make setup build
|
|
15
|
+RUN cp ./goreleaser /usr/bin
|
|
16
|
+
|
|
17
|
+# get oragono
|
6
|
18
|
RUN mkdir -p /go/src/github.com/oragono
|
7
|
19
|
WORKDIR /go/src/github.com/oragono
|
8
|
20
|
|
9
|
|
-RUN git clone https://github.com/oragono/oragono.git
|
|
21
|
+RUN git clone --recurse-submodules https://github.com/oragono/oragono.git
|
10
|
22
|
WORKDIR /go/src/github.com/oragono/oragono
|
11
|
|
-RUN git submodule update --init
|
12
|
23
|
|
13
|
24
|
# compile
|
14
|
|
-RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s" -o build/docker/oragono oragono.go
|
|
25
|
+RUN make build
|
|
26
|
+
|
15
|
27
|
|
16
|
|
-# run in a lightweight distro
|
17
|
|
-FROM alpine
|
|
28
|
+
|
|
29
|
+## run Oragono
|
|
30
|
+FROM alpine:3.9
|
|
31
|
+
|
|
32
|
+# metadata
|
|
33
|
+LABEL maintainer="daniel@danieloaks.net"
|
18
|
34
|
|
19
|
35
|
# install latest updates and configure alpine
|
20
|
36
|
RUN apk update
|
|
@@ -24,19 +40,25 @@ RUN mkdir /lib/modules
|
24
|
40
|
# standard ports listened on
|
25
|
41
|
EXPOSE 6667/tcp 6697/tcp
|
26
|
42
|
|
27
|
|
-# prep and copy oragono from build environment
|
28
|
|
-RUN mkdir -p /ircd
|
|
43
|
+# oragono itself
|
|
44
|
+RUN mkdir -p /ircd-bin
|
|
45
|
+COPY --from=build-env /go/src/github.com/oragono/oragono/dist/linux_arm64/oragono /ircd-bin
|
|
46
|
+COPY --from=build-env /go/src/github.com/oragono/oragono/languages /ircd-bin/languages/
|
|
47
|
+COPY --from=build-env /go/src/github.com/oragono/oragono/oragono.yaml /ircd-bin/oragono.yaml
|
|
48
|
+COPY run.sh /ircd-bin/run.sh
|
|
49
|
+RUN chmod +x /ircd-bin/run.sh
|
|
50
|
+
|
|
51
|
+# running volume holding config file, db, certs
|
|
52
|
+VOLUME /ircd
|
29
|
53
|
WORKDIR /ircd
|
30
|
|
-COPY --from=build-env /go/src/github.com/oragono/oragono/build/docker/ .
|
31
|
|
-COPY --from=build-env /go/src/github.com/oragono/oragono/oragono.yaml ./ircd.yaml
|
32
|
54
|
|
33
|
|
-# init
|
34
|
|
-RUN ./oragono initdb
|
35
|
|
-RUN ./oragono mkcerts
|
|
55
|
+# default motd
|
|
56
|
+COPY --from=build-env /go/src/github.com/oragono/oragono/oragono.motd /ircd/oragono.motd
|
36
|
57
|
|
37
|
58
|
# launch
|
38
|
|
-CMD ./oragono run
|
|
59
|
+CMD /ircd-bin/run.sh
|
39
|
60
|
|
40
|
|
-# uncomment to debug
|
41
|
|
-#RUN apk add bash nano
|
42
|
|
-#CMD /bin/bash
|
|
61
|
+# # uncomment to debug
|
|
62
|
+# RUN apk add --no-cache bash
|
|
63
|
+# RUN apk add --no-cache vim
|
|
64
|
+# CMD /bin/bash
|