This repository was archived by the owner on Jul 27, 2023. It is now read-only.
forked from imranismail/drone
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (29 loc) · 1.37 KB
/
Dockerfile
File metadata and controls
37 lines (29 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
FROM alpine:3 as alpine
RUN apk add -U --no-cache ca-certificates
FROM golang as golang
WORKDIR /src
ENV version v1.10.1
RUN git clone -b $version https://github.com/drone/drone.git
WORKDIR /src/drone
RUN sed -i '/replace github\.com\/h2non\/gock => gopkg\.in\/h2non\/gock\.v1 v1\.0\.14/a replace github\.com\/drone\/drone-ui => github\.com\/kfit-dev\/drone-ui v0\.0\.0-20201103123413-f1f81488f112' go.mod
RUN echo "github.com/kfit-dev/drone-ui v0.0.0-20201103123413-f1f81488f112 h1:JMWXnl9c0ZN2RCW/k8bTNgcysDnV8so9ZPfuLL2PcWU=" >> go.sum
RUN echo "github.com/kfit-dev/drone-ui v0.0.0-20201103123413-f1f81488f112/go.mod h1:5Oz3Nku8f/8PlfFzJQfgkqhOQ+SXFaCPG7Xpta9iGdA=" >> go.sum
RUN go mod download
RUN go build -ldflags "-extldflags '-static'" -tags "oss nolimit" ./cmd/drone-server
FROM alpine:3
EXPOSE 80 443
VOLUME /data
RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf
ENV GODEBUG netdns=go
ENV XDG_CACHE_HOME /data
ENV DRONE_DATABASE_DRIVER sqlite3
ENV DRONE_DATABASE_DATASOURCE /data/database.sqlite
ENV DRONE_RUNNER_OS=linux
ENV DRONE_RUNNER_ARCH=amd64
ENV DRONE_SERVER_PORT=:80
ENV DRONE_SERVER_HOST=localhost
ENV DRONE_DATADOG_ENABLED=true
ENV DRONE_DATADOG_ENDPOINT=https://stats.drone.ci/api/v1/series
COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=golang /src/drone/drone-server /bin/
ENTRYPOINT ["/bin/drone-server"]