aboutsummaryrefslogtreecommitdiff
blob: 42490174cd3772307df0a82e9f59d6205ef20bf9 (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
29
30
31
FROM golang:1.19.3 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:latest 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"
ENV PORTAGE_BINHOST="https://gentoo.osuosl.org/experimental/amd64/binpkg/default/linux/17.1/x86-64/"
RUN emerge -C openssh
RUN emerge -v -g --quiet-build dev-vcs/git
RUN echo 'FEATURES="-userpriv -usersandbox -sandbox"' >> /etc/portage/make.conf
RUN rm -rf /var/db/repos/gentoo

# We can't start from scratch and copy / due to:
# https://github.com/GoogleContainerTools/kaniko/issues/2033
# 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"]