2022-08-08 14:54:30 +02:00
|
|
|
FROM docker.io/immawanderer/fedora-hugo:linux-amd64 AS hugobuild
|
2020-10-03 21:00:19 +02:00
|
|
|
|
|
|
|
WORKDIR /homepage
|
|
|
|
|
2022-08-08 14:54:30 +02:00
|
|
|
COPY . .
|
|
|
|
|
2020-10-03 21:00:19 +02:00
|
|
|
RUN git submodule init \
|
2022-08-08 14:54:30 +02:00
|
|
|
&& git submodule update --recursive \
|
|
|
|
&& hugo version \
|
|
|
|
&& hugo --minify --gc=true --cleanDestinationDir
|
|
|
|
|
|
|
|
FROM docker.io/library/golang:1.18.5-alpine3.16 AS gobuild
|
|
|
|
COPY --from=hugobuild /homepage/ /homepage/
|
|
|
|
|
|
|
|
WORKDIR /homepage
|
|
|
|
|
|
|
|
ARG VCS_REF=development
|
|
|
|
|
|
|
|
RUN CGO_ENABLED=0 GOFLAGS='-trimpath -mod=readonly -modcacherw' \
|
|
|
|
go build -o homepage-app -v -ldflags "-s -w -X main.version=$VCS_REF" .
|
|
|
|
|
|
|
|
FROM scratch
|
|
|
|
COPY --from=gobuild /homepage/homepage-app /homepage
|
|
|
|
|
|
|
|
ENTRYPOINT ["/homepage"]
|