mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-06 22:30:56 +03:00
Set verbosity for go commands in docker build (#174)
This commit is contained in:
@@ -1,13 +1,13 @@
|
|||||||
FROM golang:alpine as builder
|
FROM golang:alpine as builder
|
||||||
|
|
||||||
RUN apk add --no-cache git gcc g++ ca-certificates \
|
RUN apk add --no-cache git gcc g++ ca-certificates \
|
||||||
&& go get -d github.com/drakkan/sftpgo
|
&& go get -v -d github.com/drakkan/sftpgo
|
||||||
WORKDIR /go/src/github.com/drakkan/sftpgo
|
WORKDIR /go/src/github.com/drakkan/sftpgo
|
||||||
ARG TAG
|
ARG TAG
|
||||||
ARG FEATURES
|
ARG FEATURES
|
||||||
# Use --build-arg TAG=LATEST for latest tag. Use e.g. --build-arg TAG=v1.0.0 for a specific tag/commit. Otherwise HEAD (master) is built.
|
# Use --build-arg TAG=LATEST for latest tag. Use e.g. --build-arg TAG=v1.0.0 for a specific tag/commit. Otherwise HEAD (master) is built.
|
||||||
RUN git checkout $(if [ "${TAG}" = LATEST ]; then echo `git rev-list --tags --max-count=1`; elif [ -n "${TAG}" ]; then echo "${TAG}"; else echo HEAD; fi)
|
RUN git checkout $(if [ "${TAG}" = LATEST ]; then echo `git rev-list --tags --max-count=1`; elif [ -n "${TAG}" ]; then echo "${TAG}"; else echo HEAD; fi)
|
||||||
RUN go build $(if [ -n "${FEATURES}" ]; then echo "-tags ${FEATURES}"; fi) -ldflags "-s -w -X github.com/drakkan/sftpgo/version.commit=`git describe --always --dirty` -X github.com/drakkan/sftpgo/version.date=`date -u +%FT%TZ`" -o /go/bin/sftpgo
|
RUN go build $(if [ -n "${FEATURES}" ]; then echo "-tags ${FEATURES}"; fi) -ldflags "-s -w -X github.com/drakkan/sftpgo/version.commit=`git describe --always --dirty` -X github.com/drakkan/sftpgo/version.date=`date -u +%FT%TZ`" -v -o /go/bin/sftpgo
|
||||||
|
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
# we use a multi stage build to have a separate build and run env
|
# we use a multi stage build to have a separate build and run env
|
||||||
FROM golang:latest as buildenv
|
FROM golang:latest as buildenv
|
||||||
LABEL maintainer="nicola.murino@gmail.com"
|
LABEL maintainer="nicola.murino@gmail.com"
|
||||||
RUN go get -d github.com/drakkan/sftpgo
|
RUN go get -v -d github.com/drakkan/sftpgo
|
||||||
WORKDIR /go/src/github.com/drakkan/sftpgo
|
WORKDIR /go/src/github.com/drakkan/sftpgo
|
||||||
ARG TAG
|
ARG TAG
|
||||||
ARG FEATURES
|
ARG FEATURES
|
||||||
# Use --build-arg TAG=LATEST for latest tag. Use e.g. --build-arg TAG=v1.0.0 for a specific tag/commit. Otherwise HEAD (master) is built.
|
# Use --build-arg TAG=LATEST for latest tag. Use e.g. --build-arg TAG=v1.0.0 for a specific tag/commit. Otherwise HEAD (master) is built.
|
||||||
RUN git checkout $(if [ "${TAG}" = LATEST ]; then echo `git rev-list --tags --max-count=1`; elif [ -n "${TAG}" ]; then echo "${TAG}"; else echo HEAD; fi)
|
RUN git checkout $(if [ "${TAG}" = LATEST ]; then echo `git rev-list --tags --max-count=1`; elif [ -n "${TAG}" ]; then echo "${TAG}"; else echo HEAD; fi)
|
||||||
RUN go build $(if [ -n "${FEATURES}" ]; then echo "-tags ${FEATURES}"; fi) -ldflags "-s -w -X github.com/drakkan/sftpgo/version.commit=`git describe --always --dirty` -X github.com/drakkan/sftpgo/version.date=`date -u +%FT%TZ`" -o sftpgo
|
RUN go build $(if [ -n "${FEATURES}" ]; then echo "-tags ${FEATURES}"; fi) -ldflags "-s -w -X github.com/drakkan/sftpgo/version.commit=`git describe --always --dirty` -X github.com/drakkan/sftpgo/version.date=`date -u +%FT%TZ`" -v -o sftpgo
|
||||||
|
|
||||||
# now define the run environment
|
# now define the run environment
|
||||||
FROM debian:latest
|
FROM debian:latest
|
||||||
|
|||||||
Reference in New Issue
Block a user