Created
April 21, 2022 10:09
-
-
Save maximko/159bcb963d4b6067605bacae63431441 to your computer and use it in GitHub Desktop.
Dockerfile to build drone ci with nolimit flag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build a container docker build -t drone-nolimit -f Dockerfile.drone-nolimit . | |
# Replace drone/drone image with drone-nolimit | |
ARG drone_version=v2.11.1 | |
FROM docker:git AS clone | |
RUN git clone --recursive https://github.com/drone/drone.git && cd drone && git checkout $drone_version | |
FROM golang:1.14 AS build | |
COPY --from=clone /drone /drone | |
WORKDIR /drone | |
RUN go build --tags "nolimit" -ldflags "-extldflags \"-static\"" -o release/linux/amd64/drone-server github.com/drone/drone/cmd/drone-server | |
FROM alpine:3.11 as alpine | |
RUN apk add -U --no-cache ca-certificates | |
FROM alpine:3.11 | |
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=false | |
COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | |
COPY --from=build /drone/release/linux/amd64/drone-server /bin/drone-server | |
ENTRYPOINT ["/bin/drone-server"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment