File tree Expand file tree Collapse file tree 2 files changed +22
-15
lines changed
Expand file tree Collapse file tree 2 files changed +22
-15
lines changed Original file line number Diff line number Diff line change 1- # Docker image using pre-compiled binaries for pocket-relay
21FROM alpine
32
43# Version listed on github
54ARG GITHUB_RELEASE_VERSION
5+ ARG TARGETARCH
66
7- RUN apk update && apk upgrade
8- RUN apk add curl
9-
10- # Set the working directory
7+ # Setup working directory
118WORKDIR /app
129
13- # Download server executable
14- RUN curl -LJ -o pocket-relay-linux https://github.com/PocketRelay/Server/releases/download/v${GITHUB_RELEASE_VERSION}/pocket-relay-linux?v=1
10+ # Install necessary tools
11+ RUN apk update && apk upgrade
12+ RUN apk add curl
1513
16- # Make the server executable
17- RUN chmod +x ./pocket-relay-linux
14+ # Determine binary based on arch
15+ RUN if [ "$TARGETARCH" = "amd64" ]; then \
16+ BINARY="pocket-relay-x86_64-linux-musl" ; \
17+ elif [ "$TARGETARCH" = "arm64" ]; then \
18+ BINARY="pocket-relay-aarch64-linux-musl" ; \
19+ else \
20+ echo "Unsupported architecture: $TARGETARCH" && exit 1; \
21+ fi && \
22+ # Download pocket-relay binary
23+ curl -L -o pocket-relay https://github.com/PocketRelay/Server/releases/download/v${GITHUB_RELEASE_VERSION}/$BINARY && \
24+ # Make binary executable
25+ chmod +x pocket-relay
1826
1927# Volume for storing database file data
2028VOLUME /app/data
2129
22- # Expore app port
30+ # Expose app port
2331EXPOSE 80
2432EXPOSE 9032/udp
2533
26- CMD ["/app/pocket-relay-linux" ]
27-
28-
34+ CMD ["/app/pocket-relay" ]
Original file line number Diff line number Diff line change @@ -54,7 +54,10 @@ run_task = [
5454condition = { env_set = [" DOCKER_IMAGE_TAG" , " GITHUB_RELEASE_VERSION" ] }
5555command = " docker"
5656args = [
57+ " buildx" ,
5758 " build" ,
59+ " --platform" ,
60+ " linux/amd64,linux/arm64" ,
5861 " ." ,
5962 " -t" ,
6063 " ${DOCKER_IMAGE_TAG}" ,
@@ -81,7 +84,6 @@ run_task = [
8184 ], parallel = true },
8285]
8386
84-
8587# ---- Pushing docker tags ----
8688
8789# Publishes the docker image using the DOCKER_IMAGE_TAG tag
@@ -93,7 +95,6 @@ command = "docker"
9395args = [" push" , " ${DOCKER_IMAGE_TAG}" ]
9496dependencies = [" build-docker" ]
9597
96-
9798# Publish the docker image using a tag created from the verson in Cargo.toml
9899[tasks .publish-docker-version ]
99100condition = { env_set = [
You can’t perform that action at this time.
0 commit comments