x-ui/Dockerfile
Alireza Ahmadi 59b7e4b38b
Some checks failed
Release X-UI / build (386) (push) Has been cancelled
Release X-UI / build (amd64) (push) Has been cancelled
Release X-UI / build (arm64) (push) Has been cancelled
Release X-UI / build (armv5) (push) Has been cancelled
Release X-UI / build (armv6) (push) Has been cancelled
Release X-UI / build (armv7) (push) Has been cancelled
Release X-UI / build (s390x) (push) Has been cancelled
Release X-UI / Build for Windows (push) Has been cancelled
Test / test (push) Has been cancelled
Release X-UI / Docker image (push) Has been cancelled
CI: per-platform Go caches, Docker image from release binaries
2026-10-11 00:12:05 +02:00

22 lines
558 B
Docker

FROM golang:1.27-alpine AS builder
WORKDIR /app
ARG TARGETARCH
ARG TARGETVARIANT
RUN apk --no-cache --update add build-base gcc wget unzip
COPY . .
ENV CGO_ENABLED=1
ENV CGO_CFLAGS="-D_LARGEFILE64_SOURCE"
RUN go build -ldflags "-w -s" -o build/x-ui main.go
RUN ./DockerInitFiles.sh "$TARGETARCH$TARGETVARIANT"
FROM alpine
LABEL org.opencontainers.image.authors="alireza7@gmail.com"
ENV TZ=Asia/Tehran
WORKDIR /app
RUN apk add --no-cache ca-certificates tzdata libcap nftables
COPY --from=builder /app/build/ /app/
VOLUME [ "/etc/x-ui" ]
CMD [ "./x-ui" ]