-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.local
37 lines (31 loc) · 959 Bytes
/
Dockerfile.local
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
FROM golang:1.16 as build-env
LABEL maintainer="Justin Hopper <justin.hopper6@t-mobile.com>"
# Copy go mod
RUN mkdir /ducklett
WORKDIR /ducklett
COPY go.mod .
COPY go.sum .
# Copy netrc for 'go get' to work
COPY .netrc /root/.netrc
# Install git
#RUN apk add git
# Download all deps
COPY . .
RUN go mod download
RUN go fmt
RUN go vet
RUN go test -race ./...
# Update image version to what we're building here
ARG RELEASE_VERSION
RUN sed -i "s|RELEASE_VERSION_HERE|$RELEASE_VERSION|" version/version.go
# Build image and utility binary
# - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o $RELEASE_NAME
# - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o update-azure-image-tags test-utility/cmd/main.go
ARG RELEASE_NAME
RUN go build -o $RELEASE_NAME
RUN go build -o update-azure-image-tags test-utility/cmd/main.go
# Build the binary
RUN make build
FROM alpine:3.13.5
COPY --from=build-env /ducklett/ducklett /ducklett
ENTRYPOINT ["/ducklett"]