Enhanced Dockerfile

This commit is contained in:
CrazyMax
2020-07-10 20:46:44 +02:00
parent b8565cea85
commit 44fb866c75
2 changed files with 6 additions and 7 deletions

View File

@@ -10,9 +10,6 @@ ENV GO111MODULE on
ENV GOPROXY https://goproxy.io
COPY --from=xgo / /
ARG TARGETPLATFORM
RUN go env
RUN apk --update --no-cache add \
build-base \
gcc \
@@ -21,11 +18,13 @@ RUN apk --update --no-cache add \
WORKDIR /app
COPY go.mod .
COPY go.sum .
COPY . ./
RUN go mod download
COPY . ./
ARG TARGETPLATFORM
ARG TARGETOS
ARG TARGETARCH
RUN go env
RUN go build -ldflags "-w -s -X 'main.version=${VERSION}'" -v -o diun cmd/main.go
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:latest

View File

@@ -22,7 +22,7 @@ type Config struct {
Providers *model.Providers `yaml:"providers,omitempty" json:"providers,omitempty" validate:"required"`
}
// Load returns Configuration struct
// Load returns Config struct
func Load(cfgfile string) (*Config, error) {
cfg := Config{
Db: (&model.Db{}).GetDefaults(),