Merge pull request #47 from wneessen/docker-mp

Dockerfile was accidentally forcing GOOS and GOARCH.
This commit is contained in:
Winni Neessen 2022-05-12 10:51:11 +02:00 committed by GitHub
commit 8531b2523b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -3,7 +3,7 @@ FROM golang:latest as builder
RUN mkdir /builddir RUN mkdir /builddir
ADD . /builddir/ ADD . /builddir/
WORKDIR /builddir WORKDIR /builddir
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags '-w -s -extldflags "-static"' -o apg-go \ RUN CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags '-w -s -extldflags "-static"' -o apg-go \
github.com/wneessen/apg-go/cmd/apg github.com/wneessen/apg-go/cmd/apg
## Create scratch image ## Create scratch image

View file

@ -10,6 +10,7 @@ import (
"github.com/wneessen/go-hibp" "github.com/wneessen/go-hibp"
"log" "log"
"os" "os"
"runtime"
"strings" "strings"
"time" "time"
) )
@ -57,6 +58,7 @@ func main() {
// Show version and exit // Show version and exit
if cfgObj.ShowVersion { if cfgObj.ShowVersion {
_, _ = os.Stderr.WriteString(`apg-go // A "Automated Password Generator"-clone v` + VersionString + "\n") _, _ = os.Stderr.WriteString(`apg-go // A "Automated Password Generator"-clone v` + VersionString + "\n")
_, _ = os.Stderr.WriteString("OS: " + runtime.GOOS + " // Arch: " + runtime.GOARCH + " \n")
_, _ = os.Stderr.WriteString("(C) 2021 by Winni Neessen\n") _, _ = os.Stderr.WriteString("(C) 2021 by Winni Neessen\n")
os.Exit(0) os.Exit(0)
} }