mirror of
https://github.com/crazy-max/diun.git
synced 2025-12-26 07:13:48 +01:00
Enhanced Dockerfile
This commit is contained in:
11
Dockerfile
11
Dockerfile
@@ -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
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user