-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile-v27
40 lines (28 loc) · 1.41 KB
/
Dockerfile-v27
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
38
39
40
FROM golang:1.21-alpine3.18 AS build-env
RUN apk add --no-cache git gcc musl-dev && \
apk add --update make
WORKDIR /go/src/github.com/devtron-labs/cirunner
ADD . /go/src/github.com/devtron-labs/cirunner/
COPY . .
# Build the binary
RUN CGO_ENABLED=0 GOOS=linux go build -buildvcs=false -a -installsuffix cgo -o /go/bin/cirunner
FROM docker:27.3-dind
# All these steps will be cached
#RUN apk add --no-cache ca-certificates
RUN apk update && apk add --no-cache --virtual .build-deps && apk add bash && apk add make && apk add curl && apk add git && apk add zip && apk add jq && \
ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime && \
apk -Uuv add groff less python3 py3-pip pipx && \
pipx ensurepath && pipx install awscli && \
cp /root/.local/bin/aws* /usr/local/bin && \
apk --purge -v del py-pip && \
rm /var/cache/apk/*
COPY --from=docker/compose:1.29.2 /usr/local/bin/docker-compose /usr/bin/docker-compose
COPY ./buildpack.json /git-ask-pass.sh /
# COPY ./git-ask-pass.sh /git-ask-pass.sh
RUN chmod +x /git-ask-pass.sh && \
(curl -sSL "https://github.com/buildpacks/pack/releases/download/v0.27.0/pack-v0.27.0-linux.tgz" | tar -C /usr/local/bin/ --no-same-owner -xzv pack)
COPY --from=build-env /go/bin/cirunner .
COPY ./ssh-config /root/.ssh/config
RUN chmod 644 /root/.ssh/config
# passing PARENT_MODE as argument to cirunner as default behavior
ENTRYPOINT ["./cirunner", "PARENT_MODE"]