Skip to content

Commit dfcb1ef

Browse files
build the binary inside Dockerfile
1 parent b9faef6 commit dfcb1ef

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Dockerfile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
1+
FROM golang:1.11.11-alpine3.8 as build
2+
3+
WORKDIR /pikolo
4+
5+
RUN apk add git gcc g++
6+
7+
COPY go.mod .
8+
RUN go mod download
9+
10+
COPY . .
11+
RUN env CGO_ENABLED=0 go build -ldflags="-s -w"
12+
113
FROM alpine:3.8
214

315
RUN apk add --update ca-certificates
416

5-
COPY dist/pikolo_linux_386/pikolo /usr/local/bin/
17+
COPY --from=build /pikolo/pikolo /usr/local/bin
618
COPY VERSION /VERSION
719

820
LABEL io.codefresh.engine="true"

0 commit comments

Comments
 (0)