mirror of
https://github.com/tenox7/wrp.git
synced 2024-12-22 06:29:16 +00:00
use golang builder
This commit is contained in:
parent
93e9fddca7
commit
d8b4f160ac
10
Dockerfile
10
Dockerfile
@ -1,6 +1,14 @@
|
|||||||
|
FROM golang as builder
|
||||||
|
WORKDIR /src
|
||||||
|
RUN git clone https://github.com/tenox7/wrp.git
|
||||||
|
WORKDIR /src/wrp
|
||||||
|
RUN go mod download
|
||||||
|
ARG TARGETARCH
|
||||||
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -o /wrp-${TARGETARCH}
|
||||||
|
|
||||||
FROM chromedp/headless-shell
|
FROM chromedp/headless-shell
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
ADD wrp-${TARGETARCH}-linux /wrp
|
COPY --from=builder /wrp-${TARGETARCH} /wrp
|
||||||
ENTRYPOINT ["/wrp"]
|
ENTRYPOINT ["/wrp"]
|
||||||
ENV PATH="/headless-shell:${PATH}"
|
ENV PATH="/headless-shell:${PATH}"
|
||||||
LABEL maintainer="as@tenoware.com"
|
LABEL maintainer="as@tenoware.com"
|
||||||
|
7
Makefile
7
Makefile
@ -13,9 +13,10 @@ cross:
|
|||||||
GOOS=linux GOARCH=arm go build -a -o wrp-arm-linux wrp.go
|
GOOS=linux GOARCH=arm go build -a -o wrp-arm-linux wrp.go
|
||||||
GOOS=linux GOARCH=arm64 go build -a -o wrp-arm64-linux wrp.go
|
GOOS=linux GOARCH=arm64 go build -a -o wrp-arm64-linux wrp.go
|
||||||
|
|
||||||
docker: wrp
|
docker-local:
|
||||||
GOOS=linux GOARCH=amd64 go build -a -o wrp-amd64-linux wrp.go
|
docker buildx build --platform linux/amd64,linux/arm64 -t tenox7/wrp:latest --load .
|
||||||
GOOS=linux GOARCH=arm64 go build -a -o wrp-arm64-linux wrp.go
|
|
||||||
|
docker-push:
|
||||||
docker buildx build --platform linux/amd64,linux/arm64 -t tenox7/wrp:latest --push .
|
docker buildx build --platform linux/amd64,linux/arm64 -t tenox7/wrp:latest --push .
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
Loading…
Reference in New Issue
Block a user