-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
37 lines (28 loc) · 976 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
32
33
34
35
36
37
# Dockerfile References: https://docs.docker.com/engine/reference/builder/
# Start from golang v1.18 base image
FROM golang:1.18-alpine AS build_base
# Add Maintainer Info
LABEL maintainer="Ed Crewe <[email protected]>"
# Install all build dependencies
# Install all build dependencies for modules
# Add bash for running tests and debugging purposes
RUN apk update \
&& apk add --virtual build-dependencies \
build-base \
gcc \
wget \
git \
&& apk add \
bash
# Set the Current Working Directory inside the container
WORKDIR $GOPATH/src/github.com/edcrewe/gormcsv
ENV GO111MODULE on
ENV CGO_CFLAGS="-g -O2 -Wno-return-local-addr"
COPY go.mod .
COPY go.sum .
RUN go mod download
RUN go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
# Copy everything from the current directory to the PWD(Present Working Directory) inside the container
COPY . .
# Run the unit tests
CMD ["go test -v --tags=u,i"]