forgot dockerfile

This commit is contained in:
Andrea Spacca 2021-07-09 22:44:07 +02:00
parent a7a3e685fe
commit ca17555c22
3 changed files with 4 additions and 5 deletions

View file

@ -6,7 +6,6 @@ bin
*.pyc
*.egg-info
.vagrant
.git
.tmp
bower_components
node_modules

View file

@ -35,7 +35,7 @@ jobs:
CGO_ENABLED: 0
run: |
go version
go build -tags netgo -ldflags '-X github.com/dutchcoders/transfer.sh/cmd.Version=${GITHUB_REF##*/} -a -s -w -extldflags "-static"' -o ./artifacts/transfersh-${GITHUB_REF##*/}-${{ matrix.suffix }}
go build -tags netgo -ldflags "-X github.com/dutchcoders/transfer.sh/cmd.Version=${GITHUB_REF##*/} -a -s -w -extldflags '-static'" -o ./artifacts/transfersh-${GITHUB_REF##*/}-${{ matrix.suffix }}
- uses: actions/upload-artifact@v2
name: Upload artifacts
with:

View file

@ -1,5 +1,5 @@
# Default to Go 1.15
ARG GO_VERSION=1.15
# Default to Go 1.16
ARG GO_VERSION=1.16
FROM golang:${GO_VERSION}-alpine as build
# Necessary to run 'go get' and to compile the linked binary
@ -12,7 +12,7 @@ WORKDIR /go/src/github.com/dutchcoders/transfer.sh
ENV GO111MODULE=on
# build & install server
RUN go get -u ./... && CGO_ENABLED=0 go build -tags netgo -ldflags '-a -s -w -extldflags "-static"' -o /go/bin/transfersh github.com/dutchcoders/transfer.sh
RUN CGO_ENABLED=0 go build -tags netgo -ldflags "-X github.com/dutchcoders/transfer.sh/cmd.Version=$(git describe --tags) -a -s -w -extldflags '-static'" -o /go/bin/transfersh
FROM scratch AS final
LABEL maintainer="Andrea Spacca <andrea.spacca@gmail.com>"