Use external image for Golang build dependencies.

This commit is contained in:
Buster "Silver Eagle" Neece 2020-01-22 22:53:07 -06:00
parent 72013d105f
commit 3c392bf864
No known key found for this signature in database
GPG Key ID: 6D9E12FF03411F4E
2 changed files with 4 additions and 31 deletions

View File

@ -15,25 +15,11 @@ RUN chmod a+x /bd_build/*.sh \
&& /bd_build/cleanup.sh \
&& rm -rf /bd_build
# SFTPGo build stage
FROM golang:stretch as sftpgo
LABEL maintainer="nicola.murino@gmail.com"
# Install SFTPgo
COPY --from=azuracast/azuracast_golang_deps:latest /usr/local/bin/sftpgo /usr/local/bin/sftpgo
RUN go get -d github.com/drakkan/sftpgo
WORKDIR /go/src/github.com/drakkan/sftpgo
ARG build_commit="8e604f888a3a3c324500ba261cd1789ee8d80f0d"
# uncomment the next line to get the latest stable version instead of the latest git
# RUN git checkout `git rev-list --tags --max-count=1`
RUN go build -i -ldflags "-s -w -X github.com/drakkan/sftpgo/utils.commit=`git describe --always --dirty` -X github.com/drakkan/sftpgo/utils.date=`date -u +%FT%TZ`" -o sftpgo
#
# Main build stage
#
FROM base
COPY --from=sftpgo /go/src/github.com/drakkan/sftpgo/sftpgo /usr/local/sbin/sftpgo
# Install Dockerize
COPY --from=azuracast/azuracast_golang_deps:latest /usr/local/bin/dockerize /usr/local/bin/dockerize
#
# START Operations as `azuracast` user

View File

@ -1,13 +0,0 @@
#!/bin/bash
set -e
source /bd_build/buildconfig
set -x
DOCKERIZE_VERSION="v0.6.1"
cd /tmp
wget --quiet https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz