瀏覽代碼

docker

Co-Authored-By: Alireza Ahmadi <[email protected]>
mhsanaei 2 月之前
父節點
當前提交
e95a748e77
共有 2 個文件被更改,包括 4 次插入2 次删除
  1. 3 1
      .github/workflows/docker.yml
  2. 1 1
      Dockerfile

+ 3 - 1
.github/workflows/docker.yml

@@ -7,7 +7,7 @@ on:
 
 jobs:
   build:
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-20.04
 
     steps:
     - uses: actions/checkout@v4
@@ -31,6 +31,8 @@ jobs:
 
     - name: Set up Docker Buildx
       uses: docker/setup-buildx-action@v3
+      with:
+        install: true
 
     - name: Login to Docker Hub
       uses: docker/login-action@v3

+ 1 - 1
Dockerfile

@@ -15,7 +15,7 @@ COPY . .
 
 ENV CGO_ENABLED=1
 ENV CGO_CFLAGS="-D_LARGEFILE64_SOURCE"
-RUN go build -o build/x-ui main.go
+RUN go build -ldflags "-w -s" -o build/x-ui main.go
 RUN ./DockerInit.sh "$TARGETARCH"
 
 # ========================================================