forked from concourse/concourse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
31 lines (25 loc) · 1.04 KB
/
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
# NOTE: this Dockerfile is purely for local development! it is *not* used for
# the official 'concourse/concourse' image.
ARG base_image=concourse/dev
FROM ${base_image} AS base
# download go modules separately so this doesn't re-run on every change
WORKDIR /src
COPY go.mod .
COPY go.sum .
RUN grep '^replace' go.mod || go mod download
# build the init executable for containerd
COPY ./cmd/init/init.c /tmp/init.c
RUN gcc -O2 -static -o /usr/local/concourse/bin/init /tmp/init.c && rm /tmp/init.c
# build Concourse without using 'packr' so that the volume in the next stage
# can live-update
COPY . .
RUN go build -gcflags=all="-N -l" -o /usr/local/concourse/bin/concourse \
./cmd/concourse
RUN set -x && \
go build -ldflags '-extldflags "-static"' -o /tmp/fly ./fly && \
tar -C /tmp -czf /usr/local/concourse/fly-assets/fly-$(go env GOOS)-$(go env GOARCH).tgz fly && \
rm /tmp/fly
# extend base stage with setup for local docker-compose workflow
FROM base
# set up a volume so locally built web UI changes auto-propagate
VOLUME /src