-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathDockerfile
More file actions
21 lines (21 loc) · 779 Bytes
/
Dockerfile
File metadata and controls
21 lines (21 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#use the golang base image
FROM golang:1.13
#copy the source files
RUN mkdir -p /go/src/github.com/cloud66-oss/starter
#switch to our app directory
WORKDIR /go/src/github.com/cloud66-oss/starter
# add the app code
ADD . /go/src/github.com/cloud66-oss/starter
# run build commands
RUN bash -c "env GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -installsuffix cgo -o compiled/starter ."
#---------
# use the alpine base image
FROM alpine:latest
RUN apk --update upgrade && apk --no-cache add curl ca-certificates && rm -rf /var/cache/apk/*
RUN mkdir -p /app
# copy the binary
COPY --from=0 /go/src/github.com/cloud66-oss/starter/compiled/starter /app
COPY ./templates /app/templates
# start command
WORKDIR /app
CMD /app/starter -daemon -templates templates -registry true