-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
48 lines (37 loc) · 1.12 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Dockerfile for building coordinated into a container.
# setup.sh will prepare prerequisites in the current directory.
# Build image
FROM golang:1.19 AS builder
# Outside GOPATH to use go modules
WORKDIR /src
# Fetch dependencies first, less susceptible to change on every build
COPY ./go.mod ./go.sum ./
RUN go mod download
# Copy in code
COPY ./ ./
RUN CGO_ENABLED=0 go build -v -o /coordinated ./cmd/coordinated
# Application image
FROM scratch
ARG VERSION
ARG BUILD
ARG NOW
COPY --from=builder /coordinated /coordinated
# CBOR-RPC interface
EXPOSE 5932
# HTTP REST interface
EXPOSE 5980
ENTRYPOINT ["/coordinated"]
LABEL name="coordinated" \
version="$VERSION" \
build="$BUILD" \
architecture="x86_64" \
build_date="$NOW" \
vendor="Diffeo, Inc." \
maintainer="Diffeo Support <support@diffeo.com>" \
url="https://github.com/diffeo/go-coordinate" \
summary="Coordinate job queue daemon" \
description="Coordinate job queue daemon" \
vcs-type="git" \
vcs-url="https://github.com/diffeo/go-coordinate" \
vcs-ref="$VERSION" \
distribution-scope="public"