Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to staged docker build #469

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
FROM alpine:3.16
# syntax=docker/dockerfile:1

ENV GOPATH /go
FROM golang:alpine as builder

RUN apk update \
&& apk add --no-cache git subversion mercurial breezy openssh tini npm rsync build-base

COPY . /src

RUN apk update \
&& apk add go git subversion libc-dev mercurial breezy openssh tini build-base npm rsync \
&& cd /src \
&& make \
&& cp .build/bin/houndd /bin \
&& rm -r .build \
&& apk del go build-base rsync npm \
&& rm -f /var/cache/apk/*
RUN --mount=type=cache,target=/go/pkg/mod \
cd /src \
&& make

FROM alpine:latest
RUN apk add --no-cache git subversion mercurial breezy openssh tini

COPY --from=builder /src/.build/bin/houndd /bin/

VOLUME ["/data"]

Expand Down