From 04581463b6917ace4405069e132d6edca8433c6d Mon Sep 17 00:00:00 2001 From: otto <965391514@qq.com> Date: Wed, 1 Nov 2023 17:15:34 +0800 Subject: [PATCH] up --- Dockerfile | 6 +++--- job.yaml | 5 ++--- job1.yaml | 21 +++++++++++++++++++++ 3 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 job1.yaml diff --git a/Dockerfile b/Dockerfile index 5a86323..130d11b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.20.5 AS builder +FROM harbor.homieyy.com/base/golang:1.20.5 AS builder #ENV CGO_ENABLED 0 #ENV GOOS linux @@ -15,7 +15,7 @@ WORKDIR /src #RUN go env -w GONOPROXY="git.gz.internal.jumaiyx.cn/" #RUN go env RUN go mod tidy -RUN go +RUN go build ./cmd/main.go FROM harbor.homieyy.com/base/alpine:3.13 @@ -23,7 +23,7 @@ RUN set -eux && sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk RUN apk update --no-cache && apk add --no-cache ca-certificates tzdata WORKDIR /app -COPY --from=builder /src/main /app/server +COPY --from=builder /src/main /app/main COPY --from=builder /src/configs /app/configs #EXPOSE 9000 ENTRYPOINT ["./main"] \ No newline at end of file diff --git a/job.yaml b/job.yaml index 90151e1..fff7caa 100644 --- a/job.yaml +++ b/job.yaml @@ -11,11 +11,10 @@ spec: spec: containers: - name: hotspot-queue-job - image: registry.internal.jumaiyx.cn/job/room-server-clear:1 - + image: harbor.homieyy.com/job/dev/hotspot-queue:364ceb13bf57f7e5029bdb23d657caa188c31e59 imagePullPolicy: IfNotPresent command: - - ./server + - ./main env: - name: JM_ENVIRONMENT value: dev diff --git a/job1.yaml b/job1.yaml new file mode 100644 index 0000000..3a94066 --- /dev/null +++ b/job1.yaml @@ -0,0 +1,21 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: hotspot-queue-job + namespace: dev +spec: + parallelism: 1 + template: + metadata: + name: hotspot-queue-job + spec: + containers: + - name: hotspot-queue-job + image: harbor.homieyy.com/job/dev/hotspot-queue:364ceb13bf57f7e5029bdb23d657caa188c31e59 + command: ["main"] + env: + - name: JM_ENVIRONMENT + value: dev + restartPolicy: OnFailure + imagePullSecrets: + - name: registry-harbor \ No newline at end of file