-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
30 lines (27 loc) · 962 Bytes
/
Dockerfile
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
FROM golang:1.9 as builder
ARG DRONE_CLI_VERSION=v0.8.5
ARG DRONE_CLI_REPO=github.com/drone/drone-cli
ARG DRONE_CLI_PACKAGE=$DRONE_CLI_REPO/drone
RUN set -x \
&& go get -v -d "$DRONE_CLI_PACKAGE" \
&& cd "$GOPATH/src/$DRONE_CLI_REPO" \
&& git checkout --detach \
&& git reset --hard "$DRONE_CLI_VERSION" \
&& git clean -df \
&& CGO_ENABLED=0 go build -a \
-ldflags "-X main.version=${DRONE_CLI_VERSION##v} -s -extldflags '-static'" \
-o /usr/local/bin/drone \
"$DRONE_CLI_PACKAGE"
FROM jenkins/jenkins:lts-alpine
LABEL maintainer="[email protected]"
USER root
COPY --from=builder /usr/local/bin/drone /usr/local/bin/drone
RUN apk update
RUN apk add docker
# docker group should have gid of 1001 instead of 101
RUN sed -ie "s/docker:x:101/docker:x:1001/g" /etc/group
# jenkins user should be in docker group
RUN adduser jenkins docker
# jenkins time zone should be set to PDT
RUN echo "America/Los_Angeles" > /etc/timezone
USER jenkins