aboutsummaryrefslogtreecommitdiff
blob: 4129dad1ffe3c0ae346f79ae38ae5cdf64aac005 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM golang:1.14.0 AS builder
WORKDIR /go/src/soko
COPY . /go/src/soko
RUN go get github.com/go-pg/pg/v9
RUN go get github.com/mcuadros/go-version
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o bin .


FROM gentoo/stage3-amd64 as gentoobuilder
# Need a portage tree to build, use last nights.
COPY --from=gentoo/portage:latest /var/db/repos/gentoo /var/db/repos/gentoo
# Sandbox doesn't work well in docker.
ENV FEATURES="-userpriv -usersandbox -sandbox"
ENV USE="-bindist"
RUN emerge -C openssh
RUN emerge --quiet-build dev-vcs/git
RUN echo 'FEATURES="-userpriv -usersandbox -sandbox"' >> /etc/portage/make.conf
RUN rm -rf /var/db/repos/gentoo


FROM scratch
COPY --from=gentoobuilder / /
COPY --from=builder /go/src/soko/assets /go/src/soko/assets
COPY --from=builder /go/src/soko/bin /go/src/soko/bin
COPY --from=builder /go/src/soko/pkg /go/src/soko/pkg
COPY --from=builder /go/src/soko/web /go/src/soko/web
WORKDIR /go/src/soko
ENTRYPOINT ["/go/src/soko/bin/update.sh"]