FROM golang:alpine as build RUN apk add --update go git gcc g++ ENV GOPATH /go RUN mkdir -p /build/gogs/ WORKDIR /build/gogs/ RUN git clone --depth 1 https://github.com/gogs/gogs.git gogs WORKDIR /build/gogs/gogs RUN CGO_CFLAGS="-D_LARGEFILE64_SOURCE" go build -o gogs -tags "sqlite" RUN rm -rf .git vendor conf docker pkg ############################# FROM alpine:latest RUN apk add --update git openssh-keygen bash ENV USER root COPY --from=build /build/gogs/gogs /gogs WORKDIR /gogs CMD ./gogs web VOLUME /gogs/custom/conf/