-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
executable file
·31 lines (24 loc) · 938 Bytes
/
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
# Base build image
FROM golang:1.11-alpine
# Install dependencies needed to build the project
RUN apk add bash ca-certificates git gcc g++ libc-dev
WORKDIR /go/src/
RUN mkdir makeclones
WORKDIR /go/src/makeclones
# Force the go compiler to use modules
ENV GO111MODULE=on
# Populate the module cache based on the go.{mod,sum} files.
COPY go.mod .
COPY go.sum .
# This is the ‘magic’ step that will download all the dependencies that are specified in
# the go.mod and go.sum file.
# Because of how the layer caching system works in Docker, the go mod download
# command will _ only_ be re-run when the go.mod or go.sum file change
# (or when we add another docker instruction this line)
RUN go mod download
# Copy the rest of the source code
COPY . .
# And compile the project!
ENV CGO_ENABLED=1
RUN GOOS=linux GOARCH=amd64 go build github.com/droxey/makeclones
RUN GOOS=darwin GOARCH=amd64 go build github.com/droxey/makeclones