-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
50 lines (30 loc) · 1006 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
FROM golang AS golang
FROM golang AS base
ENV CGO_ENABLED=0
RUN apt update && apt install -y git
ADD . /src
WORKDIR /src
RUN go mod download
FROM base AS build
RUN go build \
-tags netgo -v -a \
-o /usr/local/bin/slirunner \
-ldflags "-X main.version=$(cat ./VERSION) -extldflags \"-static\""
FROM base AS test
RUN go test -v ./...
FROM alpine AS concourse-release
ARG CONCOURSE_VERSION=6.2.0
ADD https://github.com/concourse/concourse/releases/download/v${CONCOURSE_VERSION}/concourse-${CONCOURSE_VERSION}-linux-amd64.tgz /tmp
RUN tar xvzf /tmp/concourse-${CONCOURSE_VERSION}-linux-amd64.tgz -C /usr/local
RUN tar xvzf /usr/local/concourse/fly-assets/fly-linux-amd64.tgz -C /usr/local/bin/
FROM ubuntu AS release
RUN apt update && apt install -y ca-certificates
COPY \
--from=concourse-release \
/usr/local/bin/fly \
/usr/local/bin/fly
COPY \
--from=build \
/usr/local/bin/slirunner \
/usr/local/bin/slirunner
ENTRYPOINT [ "/usr/local/bin/slirunner" ]