Dockerfile 544 B

12345678910111213141516171819202122232425262728293031323334
  1. FROM golang:alpine as build
  2. RUN apk add --update go git gcc g++
  3. ENV GOPATH /go
  4. RUN mkdir -p /build/gogs/
  5. WORKDIR /build/gogs/
  6. RUN git clone --depth 1 https://github.com/gogs/gogs.git gogs
  7. WORKDIR /build/gogs/gogs
  8. RUN CGO_CFLAGS="-D_LARGEFILE64_SOURCE" go build -o gogs -tags "sqlite"
  9. RUN rm -rf .git vendor conf docker pkg
  10. #############################
  11. FROM alpine:latest
  12. RUN apk add --update git openssh-keygen bash
  13. ENV USER root
  14. COPY --from=build /build/gogs/gogs /gogs
  15. WORKDIR /gogs
  16. CMD ./gogs web
  17. VOLUME /gogs/custom/conf/