diff --git a/DockerInitFiles.sh b/DockerInitFiles.sh index b62c0279..a87abca0 100755 --- a/DockerInitFiles.sh +++ b/DockerInitFiles.sh @@ -10,8 +10,11 @@ else FNAME="amd64"; fi mkdir -p build/bin +cd build/bin wget "https://github.com/XTLS/Xray-core/releases/download/v1.8.1/Xray-linux-${ARCH}.zip" -wget "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat" -o build/bin/geoip.dat -wget "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat" -o build/bin/geosite.dat -mv xray "build/bin/xray-linux-${FNAME}" -mv main build/x-ui \ No newline at end of file +unzip "Xray-linux-${ARCH}.zip" +rm -f "Xray-linux-${ARCH}.zip" geoip.dat geosite.dat +mv xray "xray-linux-${FNAME}" +wget "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat" +wget "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat" +cd ../../ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index ef07c95e..7787dfec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ FROM golang:1.20-alpine AS builder WORKDIR /app ARG TARGETARCH -RUN apk --no-cache --update add build-base gcc wget +RUN apk --no-cache --update add build-base gcc wget unzip COPY . . -RUN env CGO_ENABLED=1 go build main.go +RUN env CGO_ENABLED=1 go build -o build/x-ui main.go RUN ./DockerInitFiles.sh "$TARGETARCH" FROM alpine