From e01ec85a5fdcf3fe3dbb2263405a8059cf01a3db Mon Sep 17 00:00:00 2001 From: LiYanghang00 <2623197090@qq.com> Date: Mon, 16 Dec 2024 17:45:41 +0800 Subject: [PATCH] fix --- Dockerfile | 11 ++++++----- go.mod | 4 ++-- go.sum | 8 ++++---- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index e048214..07cc284 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,5 @@ -FROM openeuler/openeuler:24.03-lts as BUILDER -RUN dnf -y install golang && \ - dnf -y upgrade-minimal +FROM openeuler/go:1.23.4-oe2403lts as BUILDER +RUN dnf -y install git gcc ARG USER ARG PASS @@ -9,11 +8,13 @@ RUN echo "machine github.com login $USER password $PASS" > ~/.netrc # build binary WORKDIR /opt/source COPY . . -RUN go build -a -o robot-universal-review -buildmode=pie -ldflags "-s -linkmode 'external' -extldflags '-Wl,-z,now'" . +RUN go env -w GO111MODULE=on && \ + go env -w CGO_ENABLED=1 && \ + go build -a -o robot-universal-review -buildmode=pie -ldflags "-s -linkmode 'external' -extldflags '-Wl,-z,now'" . # copy binary config and utils FROM openeuler/openeuler:24.03-lts -RUN dnf -y upgrade-minimal && \ +RUN dnf -y upgrade && \ dnf in -y shadow && \ groupadd -g 1000 robot && \ useradd -u 1000 -g robot -s /bin/bash -m robot diff --git a/go.mod b/go.mod index 87ce2f5..bc3e8da 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/opensourceways/robot-universal-review go 1.21 require ( - github.com/opensourceways/robot-framework-lib v0.1.35-alpha + github.com/opensourceways/robot-framework-lib v0.2.1 github.com/opensourceways/server-common-lib v1.0.0 github.com/sirupsen/logrus v1.9.3 k8s.io/apimachinery v0.29.4 @@ -11,7 +11,7 @@ require ( require ( github.com/go-resty/resty/v2 v2.11.0 // indirect - github.com/opensourceways/go-gitcode v0.1.22-alpha // indirect + github.com/opensourceways/go-gitcode v0.2.0 // indirect golang.org/x/net v0.23.0 // indirect golang.org/x/sys v0.18.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index 22c15fa..f3717a5 100644 --- a/go.sum +++ b/go.sum @@ -5,10 +5,10 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-resty/resty/v2 v2.11.0 h1:i7jMfNOJYMp69lq7qozJP+bjgzfAzeOhuGlyDrqxT/8= github.com/go-resty/resty/v2 v2.11.0/go.mod h1:iiP/OpA0CkcL3IGt1O0+/SIItFUbkkyw5BGXiVdTu+A= -github.com/opensourceways/go-gitcode v0.1.22-alpha h1:FidwELPBZFN63hHdz/7Efm+xqEKmWIsEcOcorgOKTj8= -github.com/opensourceways/go-gitcode v0.1.22-alpha/go.mod h1:2BDl00PrpmMeVmD4NxO99DZiRcqx5jszNlGwPs1i9TQ= -github.com/opensourceways/robot-framework-lib v0.1.35-alpha h1:GDeOdiBnXwcyofzB8IS6QsgvqEr2Tg4ZwfPyV7bAqyw= -github.com/opensourceways/robot-framework-lib v0.1.35-alpha/go.mod h1:xawYIWy0b0MpYcN2Ri+kWo/v9CennE63tOrN/XAoD68= +github.com/opensourceways/go-gitcode v0.2.0 h1:+JJTHp4fnuQj5zfL3Y5nIxixTMbB/eGe+2/o/Xdz1K8= +github.com/opensourceways/go-gitcode v0.2.0/go.mod h1:2BDl00PrpmMeVmD4NxO99DZiRcqx5jszNlGwPs1i9TQ= +github.com/opensourceways/robot-framework-lib v0.2.1 h1:2mtwMwqzzSYZb7kEEUEiMqNYIp89vW3ude+wB5Rdoo0= +github.com/opensourceways/robot-framework-lib v0.2.1/go.mod h1:LT6nNkE9Qd+3T/ILg3LbX9j/ip9YF1Jocia4czEJZ+Y= github.com/opensourceways/server-common-lib v1.0.0 h1:uZikXrFsibI3fmSqVVWPYLBFNOM9IO8Hsux5b5neJLI= github.com/opensourceways/server-common-lib v1.0.0/go.mod h1:AVDRCS30/uJXO7WONPa1U+AQePXr488+7qZFC7EjJzE= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=