Files
torrent-indexer/.github/workflows/pipeline.dockerfile
Felipe Marinho 98f1700b21 Chore/build pipeline (#6)
* chg: chore: add linter

* chg: chore: update go

* new: chore: add pipeline

* chg: fix: dockerfile path

* chg: fix: main branch name

* chg: fix: add goimports

* chg: fix: remove goimports

* chg: fix: use goreleaser

* new: chore: add goreleaser config

* new: docs: add LICENSE

* chg: fix: container version

* chg: fix: dockerfile setup
2024-04-28 11:52:01 -03:00

26 lines
1.1 KiB
Docker

#####################################################
### Copy platform specific binary
FROM bash as copy-binary
ARG TARGETPLATFORM
RUN echo "Target Platform = ${TARGETPLATFORM}"
COPY dist .
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then cp torrentindexer_linux_amd64_linux_amd64_v1/torrent-indexer /torrent-indexer; fi
RUN if [ "$TARGETPLATFORM" = "linux/386" ]; then cp torrentindexer_linux_386_linux_386/torrent-indexer /torrent-indexer; fi
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then cp torrentindexer_linux_arm64_linux_arm64/torrent-indexer /torrent-indexer; fi
RUN if [ "$TARGETPLATFORM" = "linux/arm/v6" ]; then cp torrentindexer_linux_arm_linux_arm_6/torrent-indexer /torrent-indexer; fi
RUN if [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then cp torrentindexer_linux_arm_linux_arm_7/torrent-indexer /torrent-indexer; fi
RUN chmod +x /torrent-indexer
#####################################################
### Build Final Image
FROM alpine as release
LABEL maintainer="felipevm97@gmail.com"
COPY --from=copy-binary /torrent-indexer /app/
WORKDIR /app
ENTRYPOINT ["/app/torrent-indexer"]