Skip to content

Instantly share code, notes, and snippets.

@mvdan
Last active October 25, 2022 05:58
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save mvdan/3d29633ed1700bd1f495ced0f50c4f76 to your computer and use it in GitHub Desktop.
Save mvdan/3d29633ed1700bd1f495ced0f50c4f76 to your computer and use it in GitHub Desktop.
Dockerfile to build Drone CI as a standalone server with its nolimit flag - https://hub.docker.com/r/mvdan/drone-nolimit
FROM golang:1.14.4 AS builder
RUN apt-get update && apt-get install -y ca-certificates
RUN git clone -b v1.8.1 --depth=1 https://github.com/drone/drone
RUN cd drone && go install -trimpath -ldflags='-w -s' -tags nolimit ./cmd/drone-server
FROM debian:buster-slim
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /go/bin/drone-server /
EXPOSE 80 443
VOLUME /data
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
ENTRYPOINT ["/drone-server"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment