mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-12-17 12:44:41 +03:00
Fixed Dockerfile
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# Use the official Golang image as the base image
|
# Use the official Golang image as the base image
|
||||||
FROM --platform=$BUILDPLATFORM golang:1.20 as builder
|
FROM --platform=$BUILDPLATFORM golang:1.20 as builder
|
||||||
|
ARG TARGETOS TARGETARCH
|
||||||
# Set up the working directory
|
# Set up the working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
@@ -13,12 +13,12 @@ COPY . .
|
|||||||
|
|
||||||
ARG TARGETPARCH
|
ARG TARGETPARCH
|
||||||
|
|
||||||
RUN if [ "$TARGETPARCH" = "arm64" ]; then apt update && apt install gcc-aarch64-linux-gnu -y; fi
|
RUN if [ "$TARGETARCH" = "arm64" ]; then apt update && apt install gcc-aarch64-linux-gnu -y; fi
|
||||||
|
|
||||||
# Build the X-ui binary
|
# Build the X-ui binary
|
||||||
RUN if [ "$TARGETPARCH" = "arm64" ]; then \
|
RUN if [ "$TARGETARCH" = "arm64" ]; then \
|
||||||
GOOS=linux GOARCH=arm64 CC=aarch64-linux-gnu-gcc go build -o xui-release -v main.go; \
|
GOOS=linux GOARCH=arm64 CC=aarch64-linux-gnu-gcc go build -o xui-release -v main.go; \
|
||||||
elif [ "$TARGETPARCH" = "amd64" ]; then \
|
elif [ "$TARGETARCH" = "amd64" ]; then \
|
||||||
GOOS=linux GOARCH=amd64 go build -o xui-release -v main.go; \
|
GOOS=linux GOARCH=amd64 go build -o xui-release -v main.go; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user