diff --git a/Dockerfile b/Dockerfile index e1aaeb3..fcd403e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,14 @@ -FROM alpine:3.10 +FROM golang:1.17.5-alpine3.15 AS builder +WORKDIR /app +COPY . /app/ +RUN go build -o podsync ./cmd/podsync +FROM alpine:3.10 WORKDIR /app/ RUN wget -O /usr/bin/youtube-dl https://github.com/ytdl-org/youtube-dl/releases/latest/download/youtube-dl && \ chmod +x /usr/bin/youtube-dl && \ apk --no-cache add ca-certificates python ffmpeg tzdata -COPY podsync /app/podsync +COPY --from=builder /app/podsync /app/podsync ENTRYPOINT ["/app/podsync"] CMD ["--no-banner"] diff --git a/Makefile b/Makefile index 22e1a1c..a533d16 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,6 @@ build: TAG ?= localhost/podsync .PHONY: docker docker: - GOOS=linux GOARCH=amd64 go build -o podsync ./cmd/podsync docker build -t $(TAG) . docker push $(TAG)